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

Flow node that always returns success from run. More...

Inherits lab.AFlowNode.

Public Member Functions

override bool AddNode (ANode node)
 Adds new node as child. There can be only one child for SucceederNode, 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. SucceederNode can give only two values, 0 or 1. More...
 
- Properties inherited from lab.AFlowNode
abstract int NodeCount [get]
 Gets count of child nodes. More...
 

Detailed Description

Flow node that always returns success from run.

SucceederNode is similar to InverterNode. It has only one child node. It runs child node and does not check its result, it always returns success.

Member Function Documentation

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

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

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

Implements lab.AFlowNode.

override bool lab.SucceederNode.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.SucceederNode.GetNode ( int  i)
virtual

Gets child node.

Parameters
iIndex of child node to get. SucceederNode 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.SucceederNode.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.SucceederNode.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.SucceederNode.NodeCount
get

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


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