Changeset 5972 in orxonox.OLD for branches/network/src/util
- Timestamp:
- Dec 7, 2005, 4:59:24 PM (20 years ago)
- Location:
- branches/network/src/util/loading
- Files:
-
- 2 edited
-
game_loader.cc (modified) (13 diffs)
-
game_loader.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/util/loading/game_loader.cc
r5819 r5972 46 46 /** 47 47 * simple constructor 48 */48 */ 49 49 GameLoader::GameLoader () 50 50 { … … 55 55 56 56 57 57 58 /** 58 59 * simple deconstructor 59 */60 */ 60 61 GameLoader::~GameLoader () 61 62 { … … 66 67 67 68 68 /**69 * this class is a singleton class70 * @returns an instance of itself71 72 if you are unsure about singleton classes, check the theory out on the internet :)73 */74 GameLoader* GameLoader::getInstance()75 {76 if(singletonRef == NULL)77 singletonRef = new GameLoader();78 return singletonRef;79 }80 69 81 70 /** 82 71 * initializes the GameLoader 83 */72 */ 84 73 ErrorMessage GameLoader::init() 85 74 { … … 96 85 97 86 87 98 88 /** 99 89 * reads a campaign definition file into a campaign class 100 90 * @param fileName to be loaded 101 91 * @returns the loaded campaign 102 103 this will interprete the map/campaign files and recursivly load a tree of worlds/campaigns104 */92 * 93 * this will interprete the map/campaign files and recursivly load a tree of worlds/campaigns 94 */ 105 95 ErrorMessage GameLoader::loadCampaign(const char* fileName) 106 96 { … … 117 107 } 118 108 109 110 111 /** 112 * reads a campaign definition file into a campaign class 113 * @param fileName to be loaded 114 * @returns the loaded campaign 115 * 116 * this will interprete the map/campaign files and recursivly load a tree of worlds/campaigns 117 */ 118 ErrorMessage loadNetworkCampaign(const char* name) 119 {} 120 121 122 119 123 /** 120 124 * loads a debug campaign for test purposes only. 121 125 * @param campaignID the identifier of the campaign. 122 126 * @returns error message if not able to do so. 123 */127 */ 124 128 ErrorMessage GameLoader::loadDebugCampaign(Uint32 campaignID) 125 129 { … … 156 160 157 161 /** 158 * starts the current entity159 * @returns error code if this action has caused a error160 */162 * starts the current entity 163 * @returns error code if this action has caused a error 164 */ 161 165 ErrorMessage GameLoader::start() 162 166 { … … 167 171 168 172 /** 169 * stops the current entity170 * @returns error code if this action has caused a error171 172 ATTENTION: this function shouldn't call other functions, or if so, they must return173 after finishing. If you ignore or forget to do so, the current entity is not able to174 terminate and it will run in the background or the ressources can't be freed or even175 worse: are freed and the program will end in a segmentation fault!176 hehehe, have ya seen it... :)177 */173 * stops the current entity 174 * @returns error code if this action has caused a error 175 * 176 * ATTENTION: this function shouldn't call other functions, or if so, they must return 177 * after finishing. If you ignore or forget to do so, the current entity is not able to 178 * terminate and it will run in the background or the ressources can't be freed or even 179 * worse: are freed and the program will end in a segmentation fault! 180 * hehehe, have dja seen it... :) 181 */ 178 182 void GameLoader::stop() 179 183 { … … 184 188 185 189 /** 186 * pause the current entity187 * @returns error code if this action has caused a error188 189 this pauses the current entity or passes this call forth to the running entity.190 */190 * pause the current entity 191 * @returns error code if this action has caused a error 192 * 193 * this pauses the current entity or passes this call forth to the running entity. 194 */ 191 195 ErrorMessage GameLoader::pause() 192 196 { … … 198 202 199 203 /** 200 * resumes a pause201 * @returns error code if this action has caused a error202 203 this resumess the current entity or passes this call forth to the running entity.204 */204 * resumes a pause 205 * @returns error code if this action has caused a error 206 * 207 * this resumess the current entity or passes this call forth to the running entity. 208 */ 205 209 ErrorMessage GameLoader::resume() 206 210 { … … 224 228 * @param fileName to be loaded 225 229 * @returns the loaded campaign 226 227 this will interprete the map/campaign files and recursivly load a tree of worlds/campaigns228 */230 * 231 * this will interprete the map/campaign files and recursivly load a tree of worlds/campaigns 232 */ 229 233 Campaign* GameLoader::fileToCampaign(const char* fileName) 230 234 { … … 312 316 313 317 /** 314 \briefthis changes to the next level315 */318 * this changes to the next level 319 */ 316 320 void GameLoader::nextLevel() 317 321 { … … 322 326 323 327 /** 324 \briefchange to the previous level - not implemented325 326 this propably useless327 */328 * change to the previous level - not implemented 329 * 330 * this propably useless 331 */ 328 332 void GameLoader::previousLevel() 329 333 { … … 335 339 * load a StoryEntity 336 340 * @param element a XMLElement containing all the needed info 337 */341 */ 338 342 BaseObject* GameLoader::fabricate(const TiXmlElement* element) 339 343 { -
branches/network/src/util/loading/game_loader.h
r5819 r5972 40 40 { 41 41 42 42 43 public: 43 44 ~GameLoader (); 44 45 45 static GameLoader* getInstance(); 46 /** this class is a singleton class @returns an instance of itself */ 47 static GameLoader* getInstance() { if(singletonRef == NULL) singletonRef = new GameLoader(); return singletonRef; } 46 48 47 49 ErrorMessage init(); 48 ErrorMessage loadCampaign(const char* name);49 50 ErrorMessage start(); 50 51 void stop(); … … 56 57 void previousLevel(); 57 58 58 /** \brief a world command to send to the GameLoader @param cmd the command */59 bool worldCommand(Command* cmd);60 59 ErrorMessage loadDebugCampaign(Uint32 campaignID); 60 ErrorMessage loadCampaign(const char* name); 61 ErrorMessage loadNetworkCampaign(const char* name); 62 61 63 62 64 void registerFactory( Factory* factory ); … … 65 67 void process(const Event &event); 66 68 69 67 70 private: 68 71 GameLoader (); … … 70 73 Campaign* fileToCampaign(const char* name); 71 74 75 72 76 private: 73 77 static GameLoader* singletonRef; //!< The singleton-reference to this object
Note: See TracChangeset
for help on using the changeset viewer.










