Changeset 6063 in orxonox.OLD for branches/network/src/util
- Timestamp:
- Dec 12, 2005, 3:22:01 PM (20 years ago)
- Location:
- branches/network/src/util/loading
- Files:
-
- 2 edited
-
game_loader.cc (modified) (16 diffs)
-
game_loader.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/util/loading/game_loader.cc
r6000 r6063 46 46 /** 47 47 * simple constructor 48 */48 */ 49 49 GameLoader::GameLoader () 50 50 { … … 57 57 /** 58 58 * simple deconstructor 59 */59 */ 60 60 GameLoader::~GameLoader () 61 61 { … … 69 69 * this class is a singleton class 70 70 * @returns an instance of itself 71 72 if you are unsure about singleton classes, check the theory out on the internet :)73 */71 * 72 * if you are unsure about singleton classes, check the theory out on the internet :) 73 */ 74 74 GameLoader* GameLoader::getInstance() 75 75 { … … 81 81 /** 82 82 * initializes the GameLoader 83 */83 */ 84 84 ErrorMessage GameLoader::init() 85 85 { … … 100 100 * @param fileName to be loaded 101 101 * @returns the loaded campaign 102 103 this will interprete the map/campaign files and recursivly load a tree of worlds/campaigns104 */102 * 103 * this will interprete the map/campaign files and recursivly load a tree of worlds/campaigns 104 */ 105 105 ErrorMessage GameLoader::loadCampaign(const char* fileName) 106 106 { … … 122 122 * @param fileName to be loaded 123 123 * @returns the loaded campaign 124 125 this will interprete the map/campaign files and recursivly load a tree of worlds/campaigns126 */ 127 ErrorMessage GameLoader::loadNetworkCampaign(const char* fileName )124 * 125 * this will interprete the map/campaign files and recursivly load a tree of worlds/campaigns 126 */ 127 ErrorMessage GameLoader::loadNetworkCampaign(const char* fileName, int nodeState) 128 128 { 129 129 ErrorMessage errorCode; … … 131 131 if (campaignName) 132 132 { 133 this->currentCampaign = this->fileToNetworkCampaign(campaignName );133 this->currentCampaign = this->fileToNetworkCampaign(campaignName, nodeState); 134 134 delete[] campaignName; 135 135 } 136 // World* world0 = new World(DEBUG_WORLD_0); 137 // world0->setNextStoryID(WORLD_ID_GAMEEND); 138 // this->currentCampaign->addEntity(world0, WORLD_ID_2); 139 } 140 136 } 141 137 142 138 … … 145 141 * @param campaignID the identifier of the campaign. 146 142 * @returns error message if not able to do so. 147 */143 */ 148 144 ErrorMessage GameLoader::loadDebugCampaign(Uint32 campaignID) 149 145 { … … 180 176 181 177 /** 182 * starts the current entity183 * @returns error code if this action has caused a error184 */178 * starts the current entity 179 * @returns error code if this action has caused a error 180 */ 185 181 ErrorMessage GameLoader::start() 186 182 { … … 191 187 192 188 /** 193 * stops the current entity194 * @returns error code if this action has caused a error195 196 ATTENTION: this function shouldn't call other functions, or if so, they must return197 after finishing. If you ignore or forget to do so, the current entity is not able to198 terminate and it will run in the background or the ressources can't be freed or even199 worse: are freed and the program will end in a segmentation fault!200 hehehe, have ya seen it... :)201 */189 * stops the current entity 190 * @returns error code if this action has caused a error 191 * 192 * ATTENTION: this function shouldn't call other functions, or if so, they must return 193 * after finishing. If you ignore or forget to do so, the current entity is not able to 194 * terminate and it will run in the background or the ressources can't be freed or even 195 * worse: are freed and the program will end in a segmentation fault! 196 * hehehe, have ya seen it... :) 197 */ 202 198 void GameLoader::stop() 203 199 { … … 208 204 209 205 /** 210 * pause the current entity211 * @returns error code if this action has caused a error212 213 this pauses the current entity or passes this call forth to the running entity.214 */206 * pause the current entity 207 * @returns error code if this action has caused a error 208 * 209 * this pauses the current entity or passes this call forth to the running entity. 210 */ 215 211 ErrorMessage GameLoader::pause() 216 212 { … … 222 218 223 219 /** 224 * resumes a pause225 * @returns error code if this action has caused a error226 227 this resumess the current entity or passes this call forth to the running entity.228 */220 * resumes a pause 221 * @returns error code if this action has caused a error 222 * 223 * this resumess the current entity or passes this call forth to the running entity. 224 */ 229 225 ErrorMessage GameLoader::resume() 230 226 { … … 248 244 * @param fileName to be loaded 249 245 * @returns the loaded campaign 250 251 this will interprete the map/campaign files and recursivly load a tree of worlds/campaigns252 */246 * 247 * this will interprete the map/campaign files and recursivly load a tree of worlds/campaigns 248 */ 253 249 Campaign* GameLoader::fileToCampaign(const char* fileName) 254 250 { … … 296 292 297 293 298 299 294 /** 300 295 * reads a campaign definition file into a campaign class 301 296 * @param fileName to be loaded 302 297 * @returns the loaded campaign 303 304 this will interprete the map/campaign files and recursivly load a tree of worlds/campaigns305 */ 306 Campaign* GameLoader::fileToNetworkCampaign(const char* fileName )298 * 299 * this will interprete the map/campaign files and recursivly load a tree of worlds/campaigns 300 */ 301 Campaign* GameLoader::fileToNetworkCampaign(const char* fileName, int nodeState) 307 302 { 308 303 /* do not entirely load the campaign. just the current world … … 389 384 390 385 /** 391 \brief this changes to the next level392 */386 * \brief this changes to the next level 387 */ 393 388 void GameLoader::nextLevel() 394 389 { … … 399 394 400 395 /** 401 \briefchange to the previous level - not implemented402 403 this propably useless404 */396 * change to the previous level - not implemented 397 * 398 * this propably useless 399 */ 405 400 void GameLoader::previousLevel() 406 401 { -
branches/network/src/util/loading/game_loader.h
r6018 r6063 40 40 { 41 41 42 42 43 public: 43 44 ~GameLoader (); … … 46 47 47 48 ErrorMessage init(); 48 ErrorMessage loadCampaign(const char* name);49 ErrorMessage loadNetworkCampaign(const char* fileName);50 49 ErrorMessage start(); 51 50 void stop(); … … 54 53 ErrorMessage destroy(); 55 54 55 ErrorMessage loadCampaign(const char* name); 56 ErrorMessage loadDebugCampaign(Uint32 campaignID); 57 ErrorMessage loadNetworkCampaign(const char* fileName, int nodeState); 58 56 59 void nextLevel(); 57 60 void previousLevel(); 58 61 59 /** \brief a world command to send to the GameLoader @param cmd the command */ 60 bool worldCommand(Command* cmd); 61 ErrorMessage loadDebugCampaign(Uint32 campaignID); 62 void process(const Event &event); 62 63 63 void process(const Event &event);64 64 65 65 private: … … 67 67 68 68 Campaign* fileToCampaign(const char* name); 69 Campaign* fileToNetworkCampaign(const char* fileName); 69 Campaign* fileToNetworkCampaign(const char* fileName, int nodeState); 70 70 71 71 72 private:
Note: See TracChangeset
for help on using the changeset viewer.










