Struct amethyst::StateMachine [−][src]
pub struct StateMachine<'a, T> { /* fields omitted */ }
A simple stack-based state machine (pushdown automaton).
Methods
impl<'a, T> StateMachine<'a, T>
[src]
impl<'a, T> StateMachine<'a, T>
pub fn new<S: State<T> + 'a>(initial_state: S) -> StateMachine<'a, T>
[src]
pub fn new<S: State<T> + 'a>(initial_state: S) -> StateMachine<'a, T>
Creates a new state machine with the given initial state.
pub fn is_running(&self) -> bool
[src]
pub fn is_running(&self) -> bool
Checks whether the state machine is running.
pub fn start(&mut self, data: StateData<T>)
[src]
pub fn start(&mut self, data: StateData<T>)
pub fn handle_event(&mut self, data: StateData<T>, event: Event)
[src]
pub fn handle_event(&mut self, data: StateData<T>, event: Event)
Passes a single event to the active state to handle.
pub fn fixed_update(&mut self, data: StateData<T>)
[src]
pub fn fixed_update(&mut self, data: StateData<T>)
Updates the currently active state at a steady, fixed interval.
pub fn update(&mut self, data: StateData<T>)
[src]
pub fn update(&mut self, data: StateData<T>)
Updates the currently active state immediately.
Trait Implementations
impl<'a, T> Debug for StateMachine<'a, T>
[src]
impl<'a, T> Debug for StateMachine<'a, T>
Auto Trait Implementations
impl<'a, T> !Send for StateMachine<'a, T>
impl<'a, T> !Send for StateMachine<'a, T>
impl<'a, T> !Sync for StateMachine<'a, T>
impl<'a, T> !Sync for StateMachine<'a, T>