00001 #ifndef HEADER_STATEMANAGER_H
00002 #define HEADER_STATEMANAGER_H
00003
00004 class GameState;
00005
00006 #include "NoCopy.h"
00007
00008 #include <list>
00009
00010
00011
00012
00013 class StateManager : public NoCopy {
00014 private:
00015 typedef std::list<GameState*> t_states;
00016 t_states m_states;
00017 t_states m_trash;
00018 private:
00019 void emptyTrash();
00020 void removeState(GameState *state);
00021 void insertAfter(GameState *who, GameState *new_state);
00022 t_states::iterator findIter(GameState *who);
00023 void checkStack();
00024 void pauseBg(t_states::iterator stateIt);
00025 void resumeBg(t_states::iterator stateIt);
00026 void installHandlers();
00027 public:
00028 virtual ~StateManager();
00029 void updateGame();
00030
00031 void changeState(GameState *who, GameState *new_state);
00032 void pushState(GameState *who, GameState *new_state);
00033 void popState(GameState *who);
00034 };
00035
00036 #endif