1 |
mocchiut |
1.1 |
#include "StateManager.h" |
2 |
|
|
#include "R0_Init_State.h" |
3 |
|
|
|
4 |
|
|
namespace PamOffLineSW |
5 |
|
|
{ |
6 |
|
|
|
7 |
|
|
StateManager StateManager::instance; |
8 |
|
|
|
9 |
|
|
StateManager::StateManager() |
10 |
|
|
{ |
11 |
|
|
} |
12 |
|
|
|
13 |
|
|
StateManager::~StateManager() |
14 |
|
|
{ |
15 |
|
|
} |
16 |
|
|
|
17 |
|
|
void StateManager::changeState(State* state) |
18 |
|
|
{ |
19 |
|
|
currentState=state; |
20 |
|
|
} |
21 |
|
|
|
22 |
|
|
void StateManager::init() |
23 |
|
|
{ |
24 |
|
|
changeState(&R0_Init_State::getInstance()); |
25 |
|
|
// currentState= &R0_Init_State::getInstance(); |
26 |
|
|
} |
27 |
|
|
|
28 |
|
|
State* StateManager::getCurrentState() |
29 |
|
|
{ |
30 |
|
|
return currentState; |
31 |
|
|
} |
32 |
|
|
|
33 |
|
|
StateManager& StateManager::getInstance() |
34 |
|
|
{ |
35 |
|
|
return instance; |
36 |
|
|
} |
37 |
|
|
|
38 |
|
|
} |