Changeset 3280 for code/trunk/src/core/GameState.h
- Timestamp:
- Jul 12, 2009, 11:58:01 PM (16 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/core4 (added) merged: 3235-3237,3245-3250,3253-3254,3260-3261,3265,3270
- Property svn:mergeinfo changed
-
code/trunk/src/core/GameState.h
r3196 r3280 45 45 /** 46 46 @brief 47 Helper class to group construction parameters for better genericity. 48 */ 49 struct GameStateConstrParams 50 { 51 std::string name; 52 bool bIgnoreTickTime; 53 }; 54 55 /** 56 @brief 47 57 An implementation of a tree to manage game states. 48 58 This leads to a certain hierarchy that is created at runtime. … … 77 87 78 88 public: 79 GameState(const std::string& name, bool countTicktime = true);89 GameState(const GameStateConstrParams& params); 80 90 virtual ~GameState(); 81 91 … … 84 94 GameState* getParent() const { return this->parent_; } 85 95 86 bool getCountTickTime() const { return this->bCountTickTime_; }96 bool ignoreTickTime() const { return this->bIgnoreTickTime_; } 87 97 88 98 void addChild(GameState* state); … … 90 100 91 101 protected: 92 virtual void activate() = 0;93 virtual void deactivate() = 0;94 virtual void update(const Clock& time) = 0;102 virtual void activate() { } 103 virtual void deactivate() { } 104 virtual void update(const Clock& time) { } 95 105 96 106 private: … … 103 113 const std::string name_; 104 114 State activity_; 105 const bool b CountTickTime_;115 const bool bIgnoreTickTime_; 106 116 GameState* parent_; 107 117 std::map<std::string, GameState*> children_;
Note: See TracChangeset
for help on using the changeset viewer.