Struct aspen::BehaviorTree [] [src]

pub struct BehaviorTree<'a, S> { /* fields omitted */ }

Main behavior tree struct.

Methods

impl<'a, S> BehaviorTree<'a, S>
[src]

Create a new behavior tree with the supplied Node as the root.

Returns a reference to the root node.

Tick the behavior tree a single time.

If the tree has already been completed, ticking it again will reset it. When the tree is reset, it will return an Initialized status a single time.

Reset the tree to a state identical to before it had ran.

Run the behavior tree until it either succeeds or fails.

This makes no guarantees that it will run at the specified frequency. If a single tick takes longer than the alloted tick time, it will log a warning unless the specified frequency is infinite.

If the hook is supplied, it will be run after every tick. A reference to this behavior tree will be supplied as an argument.

NOTE: The only time this will return Status::Running is if the frequency is zero and the behavior tree is running after the first tick.

Trait Implementations

impl<'a, S> Display for BehaviorTree<'a, S>
[src]

Formats the value using the given formatter. Read more