Changeset 6365 in orxonox.OLD for branches/network
- Timestamp:
- Dec 31, 2005, 12:37:15 AM (19 years ago)
- Location:
- branches/network/src/story_entities
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/story_entities/game_world.h
r6363 r6365 38 38 39 39 /* classes from story-entity */ 40 ErrorMessage preLoad();41 ErrorMessage load ();42 ErrorMessage postLoad();40 virtual ErrorMessage preLoad(); 41 virtual ErrorMessage load (); 42 virtual ErrorMessage postLoad(); 43 43 44 44 virtual ErrorMessage preStart(); -
branches/network/src/story_entities/multi_player_world.cc
r6364 r6365 92 92 } 93 93 94 95 96 /**97 * this is executed just before load98 *99 * since the load function sometimes needs data, that has been initialized100 * before the load and after the proceeding storyentity has finished101 */102 ErrorMessage MultiPlayerWorld::preLoad()103 {104 static_cast<GameWorld*>(this)->preLoad();105 106 /* the the single player specific stuff */107 }108 109 110 /**111 * loads the MultiPlayerWorld by initializing all resources, and set their default values.112 */113 ErrorMessage MultiPlayerWorld::load()114 {115 static_cast<GameWorld*>(this)->load();116 117 /* the the single player specific stuff here */118 }119 120 121 /**122 * post loads the MultiPlayerWorld by initializing all resources, and set their default values.123 */124 ErrorMessage MultiPlayerWorld::postLoad()125 {126 static_cast<GameWorld*>(this)->postLoad();127 128 /* the single player specific stuff here */129 }130 -
branches/network/src/story_entities/multi_player_world.h
r6361 r6365 26 26 void loadParams(const TiXmlElement* root); 27 27 28 ErrorMessage preLoad();29 ErrorMessage load ();30 ErrorMessage postLoad();31 28 32 29 private: -
branches/network/src/story_entities/single_player_world.cc
r6364 r6365 95 95 96 96 97 /**98 * this is executed just before load99 *100 * since the load function sometimes needs data, that has been initialized101 * before the load and after the proceeding storyentity has finished102 */103 ErrorMessage SinglePlayerWorld::preLoad()104 {105 static_cast<GameWorld*>(this)->preLoad();106 97 107 /* the the single player specific stuff */ 108 } 98 // ErrorMessage SinglePlayerWorld::load() 99 // { 100 // static_cast<GameWorld*>(this)->load(); 101 // 102 // /* the the single player specific stuff here */ 103 // 104 // /* some static world entities */ 105 // for(int i = 0; i < 100; i++) 106 // { 107 // WorldEntity* tmp = new NPCTest1(); 108 // char npcChar[10]; 109 // sprintf (npcChar, "NPC_%d", i); 110 // tmp->setName(npcChar); 111 // tmp->setAbsCoor(((float)rand()/RAND_MAX) * 5000, 50/*+ (float)rand()/RAND_MAX*20*/, ((float)rand()/RAND_MAX -.5) *30); 112 // this->spawn(tmp); 113 // } 114 // } 109 115 110 111 /**112 * loads the SinglePlayerWorld by initializing all resources, and set their default values.113 */114 ErrorMessage SinglePlayerWorld::load()115 {116 static_cast<GameWorld*>(this)->load();117 118 /* the the single player specific stuff here */119 120 /* some static world entities */121 for(int i = 0; i < 100; i++)122 {123 WorldEntity* tmp = new NPCTest1();124 char npcChar[10];125 sprintf (npcChar, "NPC_%d", i);126 tmp->setName(npcChar);127 tmp->setAbsCoor(((float)rand()/RAND_MAX) * 5000, 50/*+ (float)rand()/RAND_MAX*20*/, ((float)rand()/RAND_MAX -.5) *30);128 this->spawn(tmp);129 }130 }131 132 133 /**134 * post loads the SinglePlayerWorld by initializing all resources, and set their default values.135 */136 ErrorMessage SinglePlayerWorld::postLoad()137 {138 static_cast<GameWorld*>(this)->postLoad();139 140 /* the single player specific stuff here */141 } -
branches/network/src/story_entities/single_player_world.h
r6360 r6365 27 27 void loadParams(const TiXmlElement* root); 28 28 29 ErrorMessage preLoad();30 ErrorMessage load ();31 ErrorMessage postLoad();32 33 29 private: 34 30 void constuctorInit(const char* name, int worldID);
Note: See TracChangeset
for help on using the changeset viewer.