Changeset 2996 for code/branches/netp3/src/core
- Timestamp:
- May 20, 2009, 4:13:26 PM (16 years ago)
- Location:
- code/branches/netp3/src/core
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/netp3/src/core/Game.cc
r2927 r2996 168 168 for (std::vector<GameState*>::const_iterator it = this->activeStates_.begin(); 169 169 it != this->activeStates_.end(); ++it) 170 { 171 // Add tick time for most of the states 172 uint64_t timeBeforeTick; 173 if ((*it)->getCountTickTime()) 174 timeBeforeTick = this->gameClock_->getRealMicroseconds(); 175 170 176 (*it)->update(*this->gameClock_); 177 178 if ((*it)->getCountTickTime()) 179 this->addTickTime(this->gameClock_->getRealMicroseconds() - timeBeforeTick); 180 } 171 181 172 182 // STATISTICS -
code/branches/netp3/src/core/Game.h
r2946 r2996 43 43 #include "OrxonoxClass.h" 44 44 45 #define AddGameState(classname, name) \ 46 static bool MACRO_CONCATENATE(bGameStateDummy_##classname, __LINE__) = orxonox::Game::addGameState(new classname(name)) 45 /** 46 @def 47 Adds a new GameState to the Game. The second parameter is the name as string 48 and every following paramter is a constructor argument (which is usually non existent) 49 */ 50 #define AddGameState(classname, ...) \ 51 static bool MACRO_CONCATENATE(bGameStateDummy_##classname, __LINE__) = orxonox::Game::addGameState(new classname(__VA_ARGS__)) 47 52 48 53 namespace orxonox -
code/branches/netp3/src/core/GameState.cc
r2896 r2996 45 45 Constructor only initialises variables and sets the name permanently. 46 46 */ 47 GameState::GameState(const std::string& name )47 GameState::GameState(const std::string& name, bool countTickTime) 48 48 : name_(name) 49 , bCountTickTime_(countTickTime) 49 50 , parent_(0) 50 51 { -
code/branches/netp3/src/core/GameState.h
r2896 r2996 78 78 79 79 public: 80 GameState(const std::string& name );80 GameState(const std::string& name, bool countTicktime = true); 81 81 virtual ~GameState(); 82 82 83 83 const std::string& getName() const { return name_; } 84 State getActivity() const { return this->activity_; } 85 GameState* getParent() const { return this->parent_; } 84 State getActivity() const { return this->activity_; } 85 GameState* getParent() const { return this->parent_; } 86 87 bool getCountTickTime() const { return this->bCountTickTime_; } 86 88 87 89 void addChild(GameState* state); … … 102 104 const std::string name_; 103 105 State activity_; 106 const bool bCountTickTime_; 104 107 GameState* parent_; 105 108 std::map<std::string, GameState*> children_;
Note: See TracChangeset
for help on using the changeset viewer.