pub struct Tree { /* private fields */ }Expand description
A decision tree framework for creating game AI structures.
Implementations§
Source§impl Tree
impl Tree
Sourcepub fn accept() -> Tree
pub fn accept() -> Tree
Creates a leaf node that represents accepting the current behavior tree.
Always get success result from this node.
§Returns
- A
Leafnode.
Sourcepub fn reject() -> Tree
pub fn reject() -> Tree
Creates a leaf node that represents rejecting the current behavior tree.
Always get failure result from this node.
§Returns
- A
Leafnode.
Sourcepub fn behave(name: &str, root: &Tree) -> Tree
pub fn behave(name: &str, root: &Tree) -> Tree
Creates a leaf node with the specified behavior tree as its root.
It is possible to include a Behavior Tree as a node in a Decision Tree by using the Behave() function. This allows the AI to use a combination of decision-making and behavior execution to achieve its goals.
§Arguments
name- The name of the behavior tree.root- The root node of the behavior tree.
§Returns
- A
Leafnode.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Tree
impl RefUnwindSafe for Tree
impl Send for Tree
impl Sync for Tree
impl Unpin for Tree
impl UnwindSafe for Tree
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