Changeset 6368 in orxonox.OLD for branches/network/src
- Timestamp:
- Dec 31, 2005, 1:40:55 PM (19 years ago)
- Location:
- branches/network/src/story_entities
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/story_entities/campaign.cc
r6360 r6368 52 52 53 53 54 /** 55 * initializes the class 56 */ 54 57 ErrorMessage Campaign::init() 55 58 { … … 57 60 } 58 61 59 /** 60 \brief loads the Parameters of a Campaign 61 * @param root: The XML-element to load from 62 63 /** 64 * loads the Parameters of a Campaign 65 * @param root: The XML-element to load from 62 66 */ 63 67 void Campaign::loadParams(const TiXmlElement* root) … … 72 76 } 73 77 74 /** 75 \brief loads a WorldList 76 * @param root: the XML-element to load from 78 79 /** 80 * loads a WorldList 81 * @param root: the XML-element to load from 77 82 */ 78 83 void Campaign::loadWorldListParams(const TiXmlElement* root) … … 93 98 } 94 99 100 /** 101 * starts the campaing 102 */ 95 103 ErrorMessage Campaign::start() 96 104 { … … 98 106 } 99 107 100 //! @todo boky -> fix it 108 109 /** 110 * starts the campaing with a specific ID 111 * @param storyID the id of the StoryEntity 112 */ 101 113 ErrorMessage Campaign::start(int storyID = 0) 102 114 { … … 127 139 se = this->getStoryEntity(nextWorldID); 128 140 this->currentEntity = se; 129 if( ( nextWorldID == WORLD_ID_GAMEEND) || ( se == NULL) )141 if( ( nextWorldID == WORLD_ID_GAMEEND) || ( se == NULL) ) 130 142 { 131 143 PRINTF(4)("Quitting campaing story loop\n"); … … 148 160 149 161 162 /** 163 * pauses the campaing 164 */ 150 165 ErrorMessage Campaign::pause() 151 166 { -
branches/network/src/story_entities/game_world.cc
r6366 r6368 83 83 GameWorld::GameWorld(const TiXmlElement* root) 84 84 { 85 this->constuctorInit("", -1); 85 this->setClassID(CL_GAME_WORLD, "GameWorld"); 86 this->setName("Preloaded World - no name yet"); 87 88 this->gameTime = 0.0f; 89 this->setSpeed(1.0); 90 this->music = NULL; 91 this->shell = NULL; 92 this->localPlayer = NULL; 93 this->localCamera = NULL; 94 95 this->showPNodes = false; 96 this->showBV = false; 97 86 98 this->path = NULL; 87 99 … … 130 142 } 131 143 132 /** 133 * initializes the world. 134 * @param name the name of the world 135 * @param worldID the ID of this world 136 * 137 * set all stuff here that is world generic and does not use to much memory 138 * because the real init() function StoryEntity::init() will be called 139 * shortly before start of the game. 140 * since all worlds are initiated/referenced before they will be started. 141 * NO LEVEL LOADING HERE - NEVER! 142 */ 143 void GameWorld::constuctorInit(const char* name, int worldID) 144 { 145 this->setClassID(CL_GAME_WORLD, "GameWorld"); 146 this->setName(name); 147 148 this->gameTime = 0.0f; 149 this->setSpeed(1.0); 150 this->music = NULL; 151 this->shell = NULL; 152 this->localPlayer = NULL; 153 this->localCamera = NULL; 154 155 this->showPNodes = false; 156 this->showBV = false; 157 } 144 158 145 159 146 /** … … 174 161 .describe("The Filename of this GameWorld (relative from the data-dir)"); 175 162 } 163 176 164 177 165 /** -
branches/network/src/story_entities/game_world.h
r6366 r6368 35 35 void loadParams(const TiXmlElement* root); 36 36 37 38 37 /* classes from story-entity */ 39 38 virtual ErrorMessage preLoad(); … … 70 69 71 70 protected: 72 virtual void constuctorInit(const char* name, int worldID);73 74 71 /* world - running functions */ 75 72 virtual void mainLoop (); -
branches/network/src/story_entities/multi_player_world.cc
r6366 r6368 116 116 */ 117 117 ErrorMessage MultiPlayerWorld::load() 118 {} 118 { 119 120 //////////////////////////// 121 // Loading Spawning Point // 122 //////////////////////////// 123 // element = root->FirstChildElement("SpawningPoints"); 124 // if( element == NULL) 125 // { 126 // PRINTF(1)("NetworkWorld is missing 'SpawningPoints'\n"); 127 // } 128 // else 129 // { 130 // element = element->FirstChildElement(); 131 // // load Players/Objects/Whatever 132 // PRINTF(4)("Loading Spawning Points\n"); 133 // while( element != NULL) 134 // { 135 // BaseObject* created = Factory::fabricate(element); 136 // if( created != NULL ) 137 // { 138 // // if(created->isA(CL_SPAWNING_POINT)) 139 // // this->spawn(dynamic_cast<WorldEntity*>(created)); 140 // printf("Created a Spawning Point %s: %s\n", created->getClassName(), created->getName()); 141 // } 142 // 143 // 144 // element = element->NextSiblingElement(); 145 // glmis->step(); //! @todo temporary 146 // } 147 // PRINTF(4)("Done loading NetworkWorldEntities\n"); 148 // } 149 // 150 // 151 // //////////////////////// 152 // // find WorldEntities // 153 // //////////////////////// 154 // element = root->FirstChildElement("WorldEntities"); 155 // if( element == NULL) 156 // { 157 // PRINTF(1)("NetworkWorld is missing 'WorldEntities'\n"); 158 // } 159 // else 160 // { 161 // element = element->FirstChildElement(); 162 // // load Players/Objects/Whatever 163 // PRINTF(4)("Loading NetworkWorldEntities\n"); 164 // while( element != NULL) 165 // { 166 // if( NetworkManager::getInstance()->isGameServer()) 167 // { 168 // 169 // BaseObject* created = NetworkGameManager::getInstance()->createEntity(element); 170 // if( created != NULL ) 171 // { 172 // // if(created->isA(CL_WORLD_ENTITY)) 173 // // this->spawn(dynamic_cast<WorldEntity*>(created)); 174 // printf("Created a %s: %s\n", created->getClassName(), created->getName()); 175 // } 176 // else 177 // PRINTF(1)("NetworkWorld: could not create this entity\n"); 178 // 179 // // if we load a 'Player' we use it as localPlayer 180 // 181 // 182 // //todo do this more elegant 183 // if( element->Value() != NULL && !strcmp( element->Value(), "SkyBox")) 184 // sky = dynamic_cast<WorldEntity*>(created); 185 // if( element->Value() != NULL && !strcmp( element->Value(), "Terrain")) 186 // { 187 // terrain = dynamic_cast<Terrain*>(created); 188 // CDEngine::getInstance()->setTerrain(terrain); 189 // 190 // } 191 // 192 // } 193 // else if( /* !strcmp( element->Value(), "SkyBox") || */ /* !strcmp( element->Value(), "Terrain") || */ !strcmp( element->Value(), "SpaceShip")) 194 // { 195 // BaseObject* created = Factory::fabricate(element); 196 // if( created != NULL ) 197 // { 198 // // if(created->isA(CL_WORLD_ENTITY)) 199 // // this->spawn(dynamic_cast<WorldEntity*>(created)); 200 // printf("Created a %s: %s\n", created->getClassName(), created->getName()); 201 // } 202 // else 203 // PRINTF(1)("NetworkWorld: could not create this entity\n"); 204 // 205 // // if we load a 'Player' we use it as localPlayer 206 // 207 // 208 // //todo do this more elegant 209 // if( element->Value() != NULL && !strcmp( element->Value(), "SkyBox")) 210 // sky = dynamic_cast<WorldEntity*>(created); 211 // if( element->Value() != NULL && !strcmp( element->Value(), "Terrain")) 212 // { 213 // terrain = dynamic_cast<Terrain*>(created); 214 // CDEngine::getInstance()->setTerrain(terrain); 215 // } 216 // } 217 // element = element->NextSiblingElement(); 218 // glmis->step(); //! @todo temporary 219 // PRINTF(4)("Done loading NetworkWorldEntities\n"); 220 // } 221 } 222 223 224 225
Note: See TracChangeset
for help on using the changeset viewer.