Trait Behavior

Source
pub trait Behavior<'a>:
    Visit
    + Default
    + PartialEq
    + Debug
    + Clone {
    type Context;

    // Required method
    fn tick(&mut self, context: &mut Self::Context) -> Status;
}
Expand description

A trait for user-defined actions for behavior tree.

Required Associated Types§

Source

type Context

A context in which the behavior will be performed.

Required Methods§

Source

fn tick(&mut self, context: &mut Self::Context) -> Status

A function that will be called each frame depending on the current execution path of the behavior tree it belongs to.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§