Changeset 3238 in orxonox.OLD for orxonox/branches/buerli/src/game_loader.cc
- Timestamp:
- Dec 20, 2004, 2:42:54 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/buerli/src/game_loader.cc
r2707 r3238 42 42 43 43 44 /** 45 \brief this class is a singleton class 46 \returns an instance of itself 47 48 if you are unsure about singleton classes, check the theory out on the internet :) 49 */ 44 50 GameLoader* GameLoader::getInstance() 45 51 { … … 50 56 51 57 52 Error GameLoader::init()58 ErrorMessage GameLoader::init() 53 59 { 54 60 if(this->currentCampaign != NULL) … … 57 63 58 64 59 Error GameLoader::loadCampaign(char* name) 60 { 61 Error errorCode; 65 /** 66 \brief reads a campaign definition file into a campaign class 67 \param filename to be loaded 68 \returns the loaded campaign 69 70 this will interprete the map/campaign files and recursivly load a tree of worlds/campaigns 71 */ 72 ErrorMessage GameLoader::loadCampaign(char* name) 73 { 74 ErrorMessage errorCode; 62 75 63 76 this->currentCampaign = this->fileToCampaign(name); 64 77 } 65 78 66 Error GameLoader::loadDebugCampaign(Uint32 campaignID) 79 80 /** 81 \brief loads a debug campaign for test purposes only. 82 \param the identifier of the campaign. 83 \returns error message if not able to do so. 84 */ 85 ErrorMessage GameLoader::loadDebugCampaign(Uint32 campaignID) 67 86 { 68 87 switch(campaignID) … … 72 91 { 73 92 Campaign* debugCampaign = new Campaign(); 93 74 94 World* world0 = new World(DEBUG_WORLD_0); 75 world0->setNextStoryID( DEBUG_WORLD_1);95 world0->setNextStoryID(WORLD_ID_1); 76 96 debugCampaign->addEntity(world0, WORLD_ID_0); 97 77 98 World* world1 = new World(DEBUG_WORLD_1); 78 99 world1->setNextStoryID(WORLD_ID_GAMEEND); … … 85 106 } 86 107 87 Error GameLoader::start()108 ErrorMessage GameLoader::start() 88 109 { 89 110 if(this->currentCampaign != NULL) … … 92 113 93 114 94 Error GameLoader::stop()115 ErrorMessage GameLoader::stop() 95 116 { 96 117 if(this->currentCampaign != NULL) … … 100 121 101 122 102 Error GameLoader::pause()123 ErrorMessage GameLoader::pause() 103 124 { 104 125 this->isPaused = true; … … 108 129 109 130 110 Error GameLoader::resume()131 ErrorMessage GameLoader::resume() 111 132 { 112 133 this->isPaused = false; … … 115 136 } 116 137 117 Error GameLoader::free() 138 /** 139 \brief release the mem 140 */ 141 ErrorMessage GameLoader::destroy() 118 142 {} 119 143 120 144 121 122 123 145 /** 146 \brief reads a campaign definition file into a campaign class 147 \param filename to be loaded 148 \returns the loaded campaign 149 150 this will interprete the map/campaign files and recursivly load a tree of worlds/campaigns 151 */ 124 152 Campaign* GameLoader::fileToCampaign(char *name) 125 153 { … … 134 162 \brief handle keyboard commands 135 163 \param cmd: the command to handle 136 \return true if the command was handled by the system164 \returns true if the command was handled by the system 137 165 */ 138 166 bool GameLoader::worldCommand (Command* cmd) … … 165 193 return true; 166 194 } 195 else if( !strcmp( cmd->cmd, "quit")) 196 { 197 if( !cmd->bUp) this->stop(); 198 return true; 199 } 167 200 return false; 168 201 } 169 202 203 204 /* 205 \brief this changes to the next level 206 */ 170 207 void GameLoader::nextLevel() 171 208 { … … 174 211 } 175 212 213 214 /* 215 \brief change to the previous level - not implemented 216 217 this propably useless 218 */ 176 219 void GameLoader::previousLevel() 177 220 {
Note: See TracChangeset
for help on using the changeset viewer.