Implements a Finite State Machine model that switches between State objects.
More...
#include <StateManager.h>
List of all members.
Detailed Description
Implements a Finite State Machine model that switches between State objects.
- Note:
- StateManager handles distribution of input and system events to both State objects and to the Gui.
Constructor & Destructor Documentation
| StateManager::StateManager |
( |
Gui * |
g |
) |
|
| StateManager::~StateManager |
( |
|
) |
|
- Note:
- Any active states are destroyed at this point as are any cross-state values.
- Todo:
- Ensure that all objects are properly destroyed and cleared.
Member Function Documentation
| void StateManager::push |
( |
Event * |
event |
) |
[protected, virtual] |
| void StateManager::setState |
( |
State * |
state |
) |
|
Sets the StateManager to run specified State.
- Note:
- State objects are destroyed when setting a new state so cross-state values will need to be saved upon destruction in the overloaded finalize() function.
- Parameters:
-
| bool StateManager::updateState |
( |
|
) |
|
Executes the updateState() on the active State
- Returns:
- bool Returns
true if there is still an active State. Otherwise returns false.
- Todo:
- Check to see if there are any memory leaks in the 'if' block. I have a sneaking suspicion that we may be leaking a few KB's when we switch to a different state.
Member Data Documentation
The documentation for this class was generated from the following files: