pub trait Behavior {
// Required method
fn tick(
&mut self,
ctx: &mut BehaviorContext<'_>,
) -> Result<BehaviorStatus, BehaviorError>;
}Expand description
Something the Arora runtime ticks once per step.
Implemented by the behavior tree (arora-behavior-tree’s TreeBehavior) and
by external interpreters such as a Vizij node graph. The runtime holds a
queue of Box<dyn Behavior> and ticks them without knowing which is which.
Not Send: the runtime is a single-owner, single-thread step loop.
Required Methods§
Sourcefn tick(
&mut self,
ctx: &mut BehaviorContext<'_>,
) -> Result<BehaviorStatus, BehaviorError>
fn tick( &mut self, ctx: &mut BehaviorContext<'_>, ) -> Result<BehaviorStatus, BehaviorError>
Advance one step. Return BehaviorStatus::Running to be ticked again,
or BehaviorStatus::Done to be dropped.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".