Tinman  1.0
statemachine.h
Go to the documentation of this file.
1 #ifndef STATEMACHINE_H
2 #define STATEMACHINE_H
3 
4 #include "game.h"
5 
6 class StateMachine {
7  typedef std::map<StateName, State::shared> StateTable;
8  StateTable state_table_;
11 
12 public:
13  typedef std::shared_ptr<StateMachine> shared;
14 
16  virtual ~StateMachine();
17 
18  void change_state(void);
19  void set_current_state(StateName next_state);
20 
21 
24 };
25 #endif
Game::shared game_
Definition: statemachine.h:10
std::shared_ptr< State > shared
Definition: state.h:33
StateTable state_table_
Definition: statemachine.h:8
void set_current_state(StateName next_state)
Definition: statemachine.cpp:72
Definition: statemachine.h:6
std::shared_ptr< StateMachine > shared
Definition: statemachine.h:13
std::shared_ptr< Game > shared
Definition: game.h:44
StateName
Definition: game.h:35
std::map< StateName, State::shared > StateTable
Definition: statemachine.h:7
StateName current_state_
Definition: statemachine.h:9
virtual ~StateMachine()
Definition: statemachine.cpp:13
StateMachine(Game::shared game)
Definition: statemachine.cpp:4
State::shared get_state(StateName state)
Definition: statemachine.cpp:79
State::shared get_current_state()
Definition: statemachine.cpp:84
void change_state(void)
Definition: statemachine.cpp:18