Changeset 6417 for code/trunk/src/libraries/core/Game.h
- Timestamp:
- Dec 25, 2009, 10:23:58 PM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/libraries/core/Game.h
r5929 r6417 50 50 #include "util/ScopeGuard.h" 51 51 #include "util/Singleton.h" 52 #include "core/OrxonoxClass.h" 52 53 53 54 /** … … 58 59 #define DeclareGameState(className, stateName, bIgnoreTickTime, bGraphicsMode) \ 59 60 static bool BOOST_PP_CAT(bGameStateDummy_##className, __LINE__) = orxonox::Game::declareGameState<className>(#className, stateName, bIgnoreTickTime, bGraphicsMode) 60 61 // tolua_begin 61 62 namespace orxonox 62 63 { 63 class GameConfiguration; 64 // tolua_end 64 65 65 66 //! Helper object required before GameStates are being constructed … … 78 79 You should only create this singleton once because it owns the Core class! (see remark there) 79 80 */ 80 class _CoreExport Game : public Singleton<Game> 81 { 81 // tolua_begin 82 class _CoreExport Game 83 // tolua_end 84 : public Singleton<Game>, public OrxonoxClass 85 { // tolua_export 82 86 friend class Singleton<Game>; 83 87 typedef std::vector<shared_ptr<GameState> > GameStateVector; … … 89 93 ~Game(); 90 94 95 void setConfigValues(); 96 91 97 void setStateHierarchy(const std::string& str); 92 98 shared_ptr<GameState> getState(const std::string& name); … … 95 101 void stop(); 96 102 97 void requestState(const std::string& name); 98 void requestStates(const std::string& names); 99 void popState(); 103 static Game& getInstance(){ return Singleton<Game>::getInstance(); } // tolua_export 104 105 void requestState(const std::string& name); //tolua_export 106 void requestStates(const std::string& names); //tolua_export 107 void popState(); //tolua_export 100 108 101 109 const Clock& getGameClock() { return *this->gameClock_; } … … 160 168 scoped_ptr<Core> core_; 161 169 ObjScopeGuard gsFactoryDestroyer_; 162 scoped_ptr<GameConfiguration> configuration_;163 170 164 171 GameStateMap constructedStates_; … … 181 188 unsigned int minimumSleepTime_; 182 189 190 // config values 191 unsigned int statisticsRefreshCycle_; 192 unsigned int statisticsAvgLength_; 193 unsigned int fpsLimit_; 194 183 195 static std::map<std::string, GameStateInfo> gameStateDeclarations_s; 184 196 static Game* singletonPtr_s; //!< Pointer to the Singleton 185 }; 197 }; //tolua_export 186 198 187 199 template <class T> … … 209 221 return true; 210 222 } 211 } 223 } //tolua_export 212 224 213 225 #endif /* _Game_H__ */
Note: See TracChangeset
for help on using the changeset viewer.