[][src]Struct amethyst::StateMachine

pub struct StateMachine<'a, T, E> { /* fields omitted */ }

A simple stack-based state machine (pushdown automaton).

Methods

impl<'a, T, E: Send + Sync + 'static> StateMachine<'a, T, E>[src]

pub fn new<S: State<T, E> + 'a>(initial_state: S) -> StateMachine<'a, T, E>[src]

Creates a new state machine with the given initial state.

pub fn is_running(&self) -> bool[src]

Checks whether the state machine is running.

pub fn start(&mut self, data: StateData<T>) -> Result<(), StateError>[src]

Initializes the state machine.

pub fn handle_event(&mut self, data: StateData<T>, event: E)[src]

Passes a single event to the active state to handle.

pub fn fixed_update(&mut self, data: StateData<T>)[src]

Updates the currently active state at a steady, fixed interval.

pub fn update(&mut self, data: StateData<T>)[src]

Updates the currently active state immediately.

pub fn transition(&mut self, request: Trans<T, E>, data: StateData<T>)[src]

Performs a state transition. Usually called by update or fixed_update by the user's defined State. This method can also be called when there are one or multiple Trans stored in the global EventChannel<TransEvent<T, E>>. Such Trans will be passed to this method sequentially in the order of insertion.

Trait Implementations

impl<'a, T, E> Debug for StateMachine<'a, T, E>[src]

Auto Trait Implementations

impl<'a, T, E> !Send for StateMachine<'a, T, E>

impl<'a, T, E> !Sync for StateMachine<'a, T, E>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Any for T where
    T: Any

impl<T> Erased for T

impl<T> Supports<T> for T

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
    D: AdaptFrom<S, Swp, Dwp, T>,
    Dwp: WhitePoint,
    Swp: WhitePoint,
    T: Component + Float
[src]

fn adapt_into(self) -> D[src]

Convert the source color to the destination color using the bradford method by default Read more

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Err = <U as TryFrom<T>>::Err