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