C# Class lab.AiTree

Exibir arquivo Open project: marekdaniluk/lab Class Usage Examples

Public Methods

Method Description
AddNode ( ANode node ) : bool

Adds new node to this AiTree.

ConnectNodes ( AFlowNode from, ANode to ) : bool

Creates connection between one node to another. The connection is one one-way and tries to prevent circular to prevent infinity loops.

DebugRun ( AiBlackboard parameters, IList trees, int level ) : bool

Runs debug this tree behaviour.

RemoveNode ( ANode node ) : bool

Removes node from this AiTree. Also removes all connections between other nodes, so it doesn't have to be done manually.

Run ( AiBlackboard parameters, IList trees, List tasks ) : bool

Runs this tree behaviour.

Private Methods

Method Description
IsConnected ( AFlowNode from, AFlowNode to ) : bool

Method Details

AddNode() public method

Adds new node to this AiTree.
public AddNode ( ANode node ) : bool
node ANode A node to add to this AiTree.
return bool

ConnectNodes() public method

Creates connection between one node to another. The connection is one one-way and tries to prevent circular to prevent infinity loops.
public ConnectNodes ( AFlowNode from, ANode to ) : bool
from AFlowNode A node that is higher in hierarchy.
to ANode A node that is lower in hierarchy.
return bool

DebugRun() public method

Runs debug this tree behaviour.
public DebugRun ( AiBlackboard parameters, IList trees, int level ) : bool
parameters AiBlackboard AiBlackboard with global parameters.
trees IList Readonly list with all ai trees.
level int Level of how deep we are in this AiTree.
return bool

RemoveNode() public method

Removes node from this AiTree. Also removes all connections between other nodes, so it doesn't have to be done manually.
public RemoveNode ( ANode node ) : bool
node ANode A node to remove from this AiTree.
return bool

Run() public method

Runs this tree behaviour.
public Run ( AiBlackboard parameters, IList trees, List tasks ) : bool
parameters AiBlackboard AiBlackboard with global parameters.
trees IList Readonly list with all ai trees.
tasks List List of task scripts to bind with task nodes.
return bool