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

Flow node that inverts result 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 InverterNode, 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. InverterNode 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 inverts result from run.

InverterNode has only one child node. On run, it takes result of child node and returns inverted value.

Member Function Documentation

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

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

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

Implements lab.AFlowNode.

override bool lab.InverterNode.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
True if child node debug run failed. Otherwise false.

Implements lab.ANode.

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

Gets child node.

Parameters
iIndex of child node to get. InverterNode 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.InverterNode.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.InverterNode.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
True if child node failed. Otherwise false.

Implements lab.ANode.

Property Documentation

override int lab.InverterNode.NodeCount
get

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


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