Changeset 1661 for code/branches/gui/src/core/GameState.h
- Timestamp:
- Aug 18, 2008, 9:17:30 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gui/src/core/GameState.h
r1660 r1661 62 62 public: 63 63 GameState(const std::string& name); 64 virtual ~GameState() { }64 virtual ~GameState(); 65 65 66 66 const std::string& getName() const { return name_; } 67 67 68 68 void addChild(GameState* state); 69 void removeChild(GameState* state); 70 void removeChild(const std::string& name); 69 71 void requestState(const std::string& name); 70 72 … … 76 78 bool isCurrentState() { return this->bActive_ && !this->activeChild_; } 77 79 80 virtual bool tick(float dt) { return true; } 81 78 82 protected: 83 //virtual void enter() = 0; 84 //virtual void leave() = 0; 85 //virtual void tick(float dt) = 0; 79 86 virtual void enter() { } 80 87 virtual void leave() { } 81 virtual void tick(float dt) { } 88 89 GameState* getActiveChild() { return this->activeChild_; } 82 90 83 91 private: … … 86 94 GameState* getRootNode(); 87 95 void grandchildAdded(GameState* child, GameState* grandchild); 96 void grandchildRemoved(GameState* grandchild); 88 97 void makeTransition(GameState* state); 89 98 void activate();
Note: See TracChangeset
for help on using the changeset viewer.