Changeset 2844 for code/branches/gui/src/core/Game.h
- Timestamp:
- Mar 25, 2009, 5:23:00 PM (16 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gui/src/core/Game.h
r2843 r2844 36 36 #define _Game_H__ 37 37 38 #include " OrxonoxPrereqs.h"38 #include "CorePrereqs.h" 39 39 #include <cassert> 40 40 #include <list> 41 #include "core/OrxonoxClass.h" 41 #include <map> 42 #include <vector> 43 #include "OrxonoxClass.h" 44 45 #define AddGameState(classname, name, ...) \ 46 static bool bGameStateDummy_##classname##__LINE__ = orxonox::Game::addGameState(new classname(name, __VA_ARGS__)) 42 47 43 48 namespace orxonox … … 47 52 Main class responsible for running the game. 48 53 */ 49 class _ OrxonoxExport Game : public OrxonoxClass54 class _CoreExport Game : public OrxonoxClass 50 55 { 51 56 public: … … 54 59 void setConfigValues(); 55 60 61 void setStateHierarchy(const std::string& str); 62 GameState* getState(const std::string& name); 63 56 64 void run(); 57 65 void stop(); 66 67 void requestState(const std::string& name); 68 void popState(); 58 69 59 70 float getAvgTickTime() { return this->avgTickTime_; } … … 62 73 void addTickTime(uint32_t length); 63 74 75 static bool addGameState(GameState* state); 64 76 static Game& getInstance() { assert(singletonRef_s); return *singletonRef_s; } 65 77 … … 73 85 Game(Game&); // don't mess with singletons 74 86 75 Core* core_;76 Clock* gameClock_;87 void loadState(GameState* state); 88 void unloadState(GameState* state); 77 89 78 bool abort_; 90 std::vector<GameState*> activeStates_; 91 GameStateTreeNode* rootStateNode_; 92 GameStateTreeNode* activeStateNode_; 93 std::vector<GameStateTreeNode*> requestedStateNodes_; 94 95 Core* core_; 96 Clock* gameClock_; 97 98 bool abort_; 79 99 80 100 // variables for time statistics 81 uint64_t statisticsStartTime_; 82 std::list<statisticsTickInfo> 83 statisticsTickTimes_; 84 uint32_t periodTime_; 85 uint32_t periodTickTime_; 86 float avgFPS_; 87 float avgTickTime_; 101 uint64_t statisticsStartTime_; 102 std::list<statisticsTickInfo> statisticsTickTimes_; 103 uint32_t periodTime_; 104 uint32_t periodTickTime_; 105 float avgFPS_; 106 float avgTickTime_; 88 107 89 108 // config values 90 unsigned int statisticsRefreshCycle_;91 unsigned int statisticsAvgLength_;109 unsigned int statisticsRefreshCycle_; 110 unsigned int statisticsAvgLength_; 92 111 112 static std::map<std::string, GameState*> allStates_s; 93 113 static Game* singletonRef_s; //!< Pointer to the Singleton 94 114 };
Note: See TracChangeset
for help on using the changeset viewer.