29#ifndef NOMLIB_SYSTEM_STATE_MACHINE_HPP
30#define NOMLIB_SYSTEM_STATE_MACHINE_HPP
36#include "nomlib/config.hpp"
53 std::unique_ptr<IState> state;
98 void set_state( std::unique_ptr<IState> state, void_ptr data );
Abstract interface for game states.
void on_event(const Event &ev)
Event handling logic for the active state.
StateMachine()
Default constructor.
void pop_state(void_ptr data)
uint32 current_state_id(void) const
Obtain the current state's identifier.
void update(float delta)
State logic handling.
uint32 next_state_id(void) const
Obtain the next state's identifier.
void set_state(std::unique_ptr< IState > state, void_ptr data)
std::vector< std::unique_ptr< IState > > states_
Stack of states.
priv::DeferredState next_state_
The pending state to be set on the next frame update.
void set_deferred_state(std::unique_ptr< IState > state, void_ptr data)
Set the next state.
~StateMachine()
Destructor.
void draw(RenderWindow &)
State rendering handling.
uint32 count() const
Get the number of active states.