[−][src]Enum ai_behavior::State
Keeps track of a behavior.
Variants
Returns Success
when button is pressed.
Returns Success
when button is released.
ActionState(A, Option<S>)
Executes an action.
Converts Success
into Failure
and vice versa.
Ignores failures and always return Success
.
Keeps track of waiting for a period of time before continuing.
f64: Total time in seconds to wait
f64: Time elapsed in seconds
Waits forever.
Keeps track of an If
behavior.
If status is Running
, then it evaluates the condition.
If status is Success
, then it evaluates the success behavior.
If status is Failure
, then it evaluates the failure behavior.
Keeps track of a Select
behavior.
Keeps track of an Sequence
behavior.
Keeps track of a While
behavior.
Keeps track of a WhenAll
behavior.
Keeps track of a WhenAny
behavior.
Keeps track of an After
behavior.
Implementations
impl<A: Clone, S> State<A, S>
[src]
pub fn new(behavior: Behavior<A>) -> Self
[src]
Creates a state from a behavior.
pub fn event<E, F>(&mut self, e: &E, f: &mut F) -> (Status, f64) where
E: GenericEvent,
F: FnMut(ActionArgs<E, A, S>) -> (Status, f64),
[src]
E: GenericEvent,
F: FnMut(ActionArgs<E, A, S>) -> (Status, f64),
Updates the cursor that tracks an event.
The action need to return status and remaining delta time. Returns status and the remaining delta time.
Passes event, delta time in seconds, action and state to closure. The closure should return a status and remaining delta time.
Trait Implementations
impl<A: Clone, S: Clone> Clone for State<A, S>
[src]
impl<'de, A, S> Deserialize<'de> for State<A, S> where
A: Deserialize<'de>,
S: Deserialize<'de>,
[src]
A: Deserialize<'de>,
S: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<A: PartialEq, S: PartialEq> PartialEq<State<A, S>> for State<A, S>
[src]
impl<A, S> Serialize for State<A, S> where
A: Serialize,
S: Serialize,
[src]
A: Serialize,
S: Serialize,
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<A, S> StructuralPartialEq for State<A, S>
[src]
Auto Trait Implementations
impl<A, S> RefUnwindSafe for State<A, S> where
A: RefUnwindSafe,
S: RefUnwindSafe,
A: RefUnwindSafe,
S: RefUnwindSafe,
impl<A, S> Send for State<A, S> where
A: Send,
S: Send,
A: Send,
S: Send,
impl<A, S> Sync for State<A, S> where
A: Sync,
S: Sync,
A: Sync,
S: Sync,
impl<A, S> Unpin for State<A, S> where
A: Unpin,
S: Unpin,
A: Unpin,
S: Unpin,
impl<A, S> UnwindSafe for State<A, S> where
A: UnwindSafe,
S: UnwindSafe,
A: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,