lab  2016-03-28
lightweight ai behaviour trees framework for Unity 3D
lab.RepeaterNode Class Reference

Flow node that always repeats running child node. More...

Inherits lab.AFlowNode.

Public Member Functions

override bool AddNode (ANode node)
 Adds new node as child. There can be only one child for RepeaterNode, so child will be overriden. More...
 
override bool RemoveNode (ANode node)
 Removes child node. More...
 
override ANode GetNode (int i)
 Gets child node. More...
 
override bool Run (AiBlackboard parameters, IList< AiTree > trees, List< ATaskScript > tasks)
 Runs this node. More...
 
override bool DebugRun (AiBlackboard parameters, IList< AiTree > trees, int level, int nodeIndex)
 Runs debug this node. More...
 

Properties

override int NodeCount [get]
 Gets count of child nodes. RepeaterNode can give only two values, 0 or 1. More...
 
int Repeat [get, set]
 Gets/Sets number of repeats. More...
 
- Properties inherited from lab.AFlowNode
abstract int NodeCount [get]
 Gets count of child nodes. More...
 

Detailed Description

Flow node that always repeats running child node.

Another AFlowNode that has only one child. RepeaterNode repeats invoking child node and at the end always returns true as the result of run.

Member Function Documentation

override bool lab.RepeaterNode.AddNode ( ANode  node)
virtual

Adds new node as child. There can be only one child for RepeaterNode, so child will be overriden.

Parameters
nodeNode to be added as a child.
Returns
Always returns true.

Implements lab.AFlowNode.

override bool lab.RepeaterNode.DebugRun ( AiBlackboard  parameters,
IList< AiTree trees,
int  level,
int  nodeIndex 
)
virtual

Runs debug this node.

Parameters
parametersAiBlackboard with global parameters.
treesReadonly list with all ai trees.
levelLevel of how deep we are in this AiTree.
nodeIndexIndex of current node in parent's node. If this is root, nodeIndex is 0.
Returns
Always returns true.

Implements lab.ANode.

override ANode lab.RepeaterNode.GetNode ( int  i)
virtual

Gets child node.

Parameters
iIndex of child node to get. RepeaterNode has one child node, so only 0 will work.
Returns
Child node if i was 0 and child node was attached. Otherwise null.

Implements lab.AFlowNode.

override bool lab.RepeaterNode.RemoveNode ( ANode  node)
virtual

Removes child node.

Parameters
nodeChild node to be removed.
Returns
True if provided node to remove is the current child node. Otherwise false.

Implements lab.AFlowNode.

override bool lab.RepeaterNode.Run ( AiBlackboard  parameters,
IList< AiTree trees,
List< ATaskScript tasks 
)
virtual

Runs this node.

Parameters
parametersAiBlackboard with global parameters.
treesReadonly list with all ai trees.
tasksList of task scripts to bind with task nodes.
Returns
Always returns true.

Implements lab.ANode.

Property Documentation

override int lab.RepeaterNode.NodeCount
get

Gets count of child nodes. RepeaterNode can give only two values, 0 or 1.

int lab.RepeaterNode.Repeat
getset

Gets/Sets number of repeats.


The documentation for this class was generated from the following file: