Trait aspen::node::Internals
[−]
[src]
pub trait Internals { fn tick(&mut self) -> Status; fn reset(&mut self); fn type_name(&self) -> &'static str; fn children(&self) -> Option<Vec<&Node>> { ... } }
The internal logic of a node.
This is the object that controls the tick behavior of the Node
, with
Node
just being a wrapper to enforce some runtime behavior.
Required Methods
fn tick(&mut self) -> Status
Ticks the internal state of the node a single time.
Node internals should not automatically reset themselves. If a node has
been run to completion, the Node
that holds this object will call
reset
before ticking the node.
In other words, the Internals
will only ever be ticked when the node
state is either Status::Running
or Status::Initialized
.
fn reset(&mut self)
Resets the internal state of the node.
This sets the node to a state that is identical to a newly constructed node. Note that this could be called when the node is in any state.
fn type_name(&self) -> &'static str
Returns the type of the node as a string literal.
In general, this should be the name of the node type. However, there
are plans to add a "name" property to the Node
struct, at which point
this function will be depricated.
Provided Methods
fn children(&self) -> Option<Vec<&Node>>
Returns a vector of references to this node's children.
Default behavior is to return None
, which should be suitable for any
leaf node.
Implementors
impl Internals for ActiveSequence
impl Internals for Sequence
impl Internals for ActiveSelector
impl Internals for Selector
impl Internals for Parallel
impl Internals for Decorator
impl Internals for Repeat
impl Internals for UntilFail
impl Internals for UntilSuccess
impl Internals for Invert
impl Internals for Action
impl Internals for Condition
impl Internals for AlwaysFail
impl Internals for AlwaysSucceed
impl Internals for AlwaysRunning