pub struct Node<T> {
pub name: Option<String>,
pub behavior: Behavior<T>,
pub status: Status,
pub collapse_as: Option<String>,
}
Fields§
§name: Option<String>
§behavior: Behavior<T>
§status: Status
§collapse_as: Option<String>
Implementations§
Source§impl<T> Node<T>
impl<T> Node<T>
pub fn new_named(name: String, behavior: Behavior<T>) -> Node<T>
pub fn action(name: &str, func: fn(&mut T) -> Status) -> Node<T>
pub fn action_success(name: &str, func: fn(&mut T)) -> Node<T>
pub fn stateful_action(name: &str, func: Box<dyn StatefulAction<T>>) -> Node<T>
pub fn sequence(nodes: Vec<Node<T>>) -> Node<T>
pub fn named_sequence(name: &str, nodes: Vec<Node<T>>) -> Node<T>
pub fn select(nodes: Vec<Node<T>>) -> Node<T>
pub fn named_select(name: &str, nodes: Vec<Node<T>>) -> Node<T>
pub fn cond( name: &str, cond: fn(&T) -> bool, success: Node<T>, failure: Node<T>, ) -> Node<T>
pub fn wait(time: f64) -> Node<T>
pub fn random_wait(time: f64) -> Node<T>
pub fn named_while_single( name: &str, cond: Box<dyn Fn(&T) -> bool>, child: Node<T>, ) -> Node<T>
pub fn named_while_single_child( name: &str, cond: Box<dyn Fn(&T) -> bool>, child: Rc<RefCell<Node<T>>>, ) -> Node<T>
pub fn collapse(self, desc: &str) -> Node<T>
pub fn reset(&mut self)
pub fn tick(&mut self, delta: f64, context: &mut T) -> Status
pub fn children(&self) -> Vec<Rc<RefCell<Node<T>>>>
pub fn name(&self) -> String
pub fn recheck_condition(&mut self, context: &T, is_sequence: bool) -> bool
Auto Trait Implementations§
impl<T> Freeze for Node<T>
impl<T> !RefUnwindSafe for Node<T>
impl<T> !Send for Node<T>
impl<T> !Sync for Node<T>
impl<T> Unpin for Node<T>
impl<T> !UnwindSafe for Node<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more