Class: Tick

Tick

A new Tick object is instantiated every tick by BehaviorTree. It is passed as parameter to the nodes through the tree during the traversal. The role of the Tick class is to store the instances of tree, target and process. So, all nodes can access it.

new Tick( [process] [, tree] [, target] [, depth])

constructoor
Parameters:
Name Type Argument Default Description
process Process <optional>
null
tree BehaviorTree <optional>
null
target Target <optional>
null
depth number <optional>
0

Members


depth :number

The depth of the current execution from FSM root
Type:
  • number
Properties:
Name Type Description
depth

<readonly> process :process

The process reference.
Type:
  • process
Properties:
Name Type Description
process

<readonly> processId :string

The process id.
Type:
  • string
Properties:
Name Type Description
processId

<readonly> target :Target

The target object reference.
Type:
  • Target
Properties:
Name Type Description
target

<readonly> tree :BehaviorTree

The tree reference.
Type:
  • BehaviorTree
Properties:
Name Type Description
tree

<readonly> treeId :string

The tree id.
Type:
  • string
Properties:
Name Type Description
treeId

Methods


<protected> _enterNode(node)

Called when entering a node (called by BaseNode).
Parameters:
Name Type Description
node Object The node that called this method.

<protected> _exitNode(node)

Callback when exiting a node (called by BaseNode).
Parameters:
Name Type Description
node Object The node that called this method.

<protected> _openNode(node)

Callback when opening a node (called by BaseNode).
Parameters:
Name Type Description
node Object The node that called this method.

<protected> _tickNode(node)

Callback when ticking a node (called by BaseNode).
Parameters:
Name Type Description
node Object The node that called this method.

copyFrom(tickOptions)

copy-construct Tick from another tick instace
Parameters:
Name Type Description
tickOptions Object

decrementDepth()

decrement tick Depth

incrementDepth()

increment tick depth

resetAll()

reset all the process data, the target and the