- Timestamp:
- Jan 10, 2006, 2:00:20 AM (19 years ago)
- Location:
- branches/network/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/network/network_game_manager.cc
r6424 r6459 25 25 26 26 #include "p_node.h" 27 #include "state.h" 28 #include "game_world.h" 29 #include "world_entity.h" 27 30 28 31 … … 474 477 s->setIsOutOfSync( true ); 475 478 PRINTF(0)("Fabricated %s with id %d\n", s->getClassName(), s->getUniqueID()); 479 480 481 if( !strcmp( s->getClassName(), "SkyBox")) 482 { 483 PRINTF(0)("==> Created the Sky!\n"); 484 (dynamic_cast<GameWorld*>(State::getCurrentStoryEntity()))->setSky( dynamic_cast<WorldEntity*>(s) ); 485 } 486 // this->sky = dynamic_cast<WorldEntity*>(created); 487 if( !strcmp( s->getClassName(), "Terrain")) 488 { 489 PRINTF(0)("==> Created the Terrain\n"); 490 // this->terrain = dynamic_cast<Terrain*>(created); 491 // CDEngine::getInstance()->setTerrain(terrain); 492 } 493 476 494 return b; 477 495 } -
branches/network/src/story_entities/game_world.cc
r6424 r6459 200 200 this->isRunning = true; 201 201 202 State::setCurrentStoryEntity(dynamic_cast<StoryEntity*>(this)); 203 202 204 this->run(); 203 205 } -
branches/network/src/story_entities/game_world.h
r6424 r6459 9 9 10 10 #include "story_entity.h" 11 11 #include "game_world_data.h" 12 12 13 13 class TiXmlElement; … … 56 56 57 57 58 inline void setSky(WorldEntity* sky) { this->dataTank->sky = sky; } 59 60 58 61 protected: 59 62 /* world - running functions */ -
branches/network/src/story_entities/multi_player_world_data.cc
r6424 r6459 48 48 49 49 #include "glmenu_imagescreen.h" 50 50 51 51 52 … … 177 178 this->localPlayer = new Player(); 178 179 Playable* playable; 179 const list<BaseObject*>* playableList = ClassList::getList(CL_PLAYABLE); 180 const std::list<BaseObject*>* playableList = ClassList::getList(CL_PLAYABLE); 181 assert( playableList != NULL); 182 183 std::list<BaseObject*>::const_iterator entity; 184 for (entity = playableList->begin(); entity != playableList->end(); entity++) 185 PRINTF(0)("Got a playable, class: %s, name: %s\n", (*entity)->getClassName(), (*entity)->getName()); 186 187 180 188 if (playableList != NULL) 181 189 { … … 184 192 } 185 193 186 187 194 /* init the pnode tree */ 188 195 PNode::getNullParent()->init(); -
branches/network/src/util/state.cc
r6222 r6459 31 31 ObjectManager* State::objectManager = NULL; 32 32 33 StoryEntity* State::storyEntity = NULL; 34 33 35 /** 34 36 * sets camera and target of the current Camera -
branches/network/src/util/state.h
r6222 r6459 7 7 #define _STATE_H 8 8 9 9 10 // FORWARD DECLARATION 10 11 class PNode; 11 12 class WorldEntity; 12 13 class ObjectManager; 14 class StoryEntity; 13 15 14 16 //! handles states about orxonox's most importatn objects … … 39 41 static inline ObjectManager* getObjectManager() { return State::objectManager; }; 40 42 43 ////////////////////// 44 /// STORY-ENTITY /// 45 ////////////////////// 46 /** @param storyEntity sets the current StoryEntity that is been played */ 47 static inline void setCurrentStoryEntity(StoryEntity* storyEntity) { State::storyEntity = storyEntity; }; 48 /** @returns the current StoryEntity played */ 49 static inline StoryEntity* getCurrentStoryEntity() { return State::storyEntity; }; 50 51 41 52 ///////////////////////// 42 53 /// WORLD_ENTITY_LIST /// … … 49 60 static PNode* cameraTarget; //!< A reference to the cameraTarget 50 61 static PNode* nullParent; //!< A reference to the Null-PNode. 51 static ObjectManager* objectManager; //!< A referenct to the current ObjectManager 62 static ObjectManager* objectManager; //!< A reference to the current ObjectManager 63 static StoryEntity* storyEntity; //!< A reference to the current StoryEntity played 52 64 53 65 };
Note: See TracChangeset
for help on using the changeset viewer.