Struct game_engine_core::StateMachine [−][src]
pub struct StateMachine<S> { /* fields omitted */ }
Expand description
A state machine that holds the stack of states and performs transitions between states. It can be created using
ⓘ
StateMachine::<()>::default()
Generics
- S: State data, the data that is sent to states for them to do their operations.
Implementations
impl<S> StateMachine<S>
[src]
impl<S> StateMachine<S>
[src]pub fn is_running(&self) -> bool
[src]
pub fn is_running(&self) -> bool
[src]Returns if the state machine still has states in its stack.
pub fn update(&mut self, state_data: &mut S)
[src]
pub fn update(&mut self, state_data: &mut S)
[src]Updates the state at the top of the stack with the provided data. If the states returns a transition, perform it.
Trait Implementations
impl<S> Default for StateMachine<S>
[src]
impl<S> Default for StateMachine<S>
[src]pub fn default() -> StateMachine<S>
[src]
pub fn default() -> StateMachine<S>
[src]Returns the “default value” for a type. Read more