Struct amethyst_engine::StateMachine [] [src]

pub struct StateMachine {
    // some fields omitted
}

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

Methods

impl StateMachine
[src]

fn new<T: 'static>(initial_state: T) -> StateMachine where T: State

fn is_running(&self) -> bool

Checks whether the state machine is running.

fn start(&mut self)

Initializes the state machine.

Panics

Panics if no states are present in the stack.

fn handle_events(&mut self, events: &[i32])

Passes a vector of events to the active state to handle.

fn fixed_update(&mut self, delta_time: Duration)

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

fn update(&mut self, delta_time: Duration)

Updates the currently active state immediately.