- Timestamp:
- Feb 3, 2006, 4:34:44 PM (19 years ago)
- Location:
- trunk/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/defs/debug.h
r6868 r7020 91 91 92 92 #define DEBUG_MODULE_STORY_ENTITY 2 93 #define DEBUG_MODULE_GAME_RULES 2 93 94 94 95 #define DEBUG_MODULE_WEAPON 2 -
trunk/src/story_entities/game_world_data.cc
r6988 r7020 57 57 #include "animation_player.h" 58 58 #include "animation3d.h" 59 60 #include "game_rules.h" 59 61 60 62 #include "ogg_player.h" … … 302 304 LoadParam(root, "Music", this, GameWorldData, setSoundTrack); 303 305 304 // LoadParamXML(root, "ParticleEngine", ParticleEngine::getInstance(), ParticleEngine, loadParams); 306 307 LoadParamXML(root, "GameRule", this, GameWorldData, loadGameRule); 308 309 310 //LoadParamXML(root, "ParticleEngine", ParticleEngine::getInstance(), ParticleEngine, loadParams); 305 311 //LoadParamXML(root, "PhysicsEngine", PhysicsEngine::getInstance(), PhysicsEngine, loadParams); 306 312 … … 310 316 SoundEngine::getInstance()->setListener(this->localCamera); 311 317 } 318 312 319 313 320 … … 353 360 354 361 362 void GameWorldData::loadGameRule(const TiXmlElement* root) 363 { 364 365 const TiXmlElement* element = root->FirstChildElement("GameRule"); 366 367 if( element == NULL) 368 { 369 PRINTF(1)("GameWorld is missing 'GameRule'\n"); 370 } 371 else 372 { 373 element = element->FirstChildElement(); 374 375 while( element != NULL) 376 { 377 BaseObject* created = Factory::fabricate(element); 378 if (created == NULL /*|| !created->isA(CL_GAME_RULE)*/) 379 delete created; 380 else 381 { 382 this->gameRule = dynamic_cast<GameRules*>(created); 383 element = element->NextSiblingElement(); 384 } 385 } 386 } 387 388 389 390 } 391 392 393 -
trunk/src/story_entities/game_world_data.h
r6827 r7020 22 22 class TiXmlElement; 23 23 class OggPlayer; 24 class GameRules; 24 25 25 26 … … 42 43 /* interface functions */ 43 44 void setSoundTrack(const char* name); 45 void loadGameRule(const TiXmlElement* root); 44 46 45 47 protected: … … 62 64 OggPlayer* music; //!< Reference to the SoundEngine's music player (OggPlayer) 63 65 ObjectManager* objectManager; //!< Reference to the objects manager 66 67 GameRules* gameRule; //!< Reference to the game rules of this game 64 68 }; 65 69 -
trunk/src/util/Makefile.am
r6437 r7020 9 9 state.cc \ 10 10 hud.cc \ 11 game_rules.cc \ 11 12 animation/animation3d.cc \ 12 13 animation/animation.cc \ … … 24 25 state.h \ 25 26 hud.h \ 27 game_rules.h \ 26 28 animation/animation3d.h \ 27 29 animation/animation.h \ -
trunk/src/util/game_rules.cc
r7017 r7020 13 13 */ 14 14 15 #define DEBUG_MODULE_ STORY_ENTITY15 #define DEBUG_MODULE_GAME_RULES 16 16 17 17 #include "game_rules.h" 18 19 #include "load_param.h" 18 20 19 21 … … 21 23 22 24 23 GameRules::GameRules() 25 /** 26 * constructor 27 */ 28 GameRules::GameRules(const TiXmlElement root) 29 {} 30 31 /** 32 * decontsructor 33 */ 34 GameRules::~GameRules() 24 35 {} 25 36 26 37 27 GameRules::~GameRules() 38 39 void GameRules::loadParams(const TiXmlElement* root) 28 40 {} 41 -
trunk/src/util/game_rules.h
r7017 r7020 11 11 12 12 13 class TiXmlElement; 14 class ObjectManager; 13 15 14 16 … … 17 19 18 20 public: 19 GameRules( );21 GameRules(const TiXmlElement root); 20 22 virtual ~GameRules(); 21 23 24 virtual void loadParams(const TiXmlElement* root); 25 26 27 virtual void tick(float dt) = 0; 28 29 22 30 private: 31 ObjectManager* pObjectManager; //!< reference to the current Object Manager 32 }; 23 33 24 }; 34 35 #endif /* _GAME_RULES_H */
Note: See TracChangeset
for help on using the changeset viewer.