1681-engine / index / BtNode
Interface: BtNode<C> ​
Defined in: src/ai/behaviorTree.ts:8
One node of a tree. Nodes hold no state of their own, so one tree drives any number of agents: what a node must remember between ticks (the child a sequence is on, when a wait began) lives in the agent's memory, run.state.
Type Parameters ​
| Type Parameter |
|---|
C |
Properties ​
children ​
ts
readonly children: readonly BtNode<C>[];Defined in: src/ai/behaviorTree.ts:12
kind ​
ts
readonly kind: string;Defined in: src/ai/behaviorTree.ts:9
name? ​
ts
readonly optional name?: string;Defined in: src/ai/behaviorTree.ts:11
Shown in a trace; actions and conditions are named after what they do.
Methods ​
halt()? ​
ts
optional halt(ctx, run): void;Defined in: src/ai/behaviorTree.ts:15
A running node left behind (its parent moved on, the tree was reset): undo what it started.
Parameters ​
| Parameter | Type |
|---|---|
ctx | C |
run | BtRun<C> |
Returns ​
void
tick() ​
ts
tick(ctx, run): BtStatus;Defined in: src/ai/behaviorTree.ts:13
Parameters ​
| Parameter | Type |
|---|---|
ctx | C |
run | BtRun<C> |