Changeset 7461 in orxonox.OLD for trunk/src/util/game_rules.cc
- Timestamp:
- May 1, 2006, 1:47:53 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/util/game_rules.cc
r7193 r7461 18 18 19 19 #include "util/loading/load_param.h" 20 #include "util/loading/factory.h" 21 22 #include "util/mission_goal.h" 23 20 24 21 25 … … 42 46 { 43 47 BaseObject::loadParams(root); 48 49 LoadParamXML(root, "MissionGoal", this, GameRules, loadMissionGoal) 50 .describe("an XML-Element to load the missions from"); 44 51 } 45 52 53 54 55 void GameRules::loadMissionGoal(const TiXmlElement* root) 56 { 57 const TiXmlElement* element = root->FirstChildElement(); 58 while( element != NULL) 59 { 60 PRINTF(2)("============ MissionGoal\n"); 61 PRINTF(2)("Adding Mission Goal:%s\n", element->Value()); 62 BaseObject* created = Factory::fabricate(element); 63 if (created != NULL && created->isA(CL_GAME_RULES)) 64 { 65 MissionGoal* mg = dynamic_cast<MissionGoal*>(created); 66 this->addMissionGoal(mg); 67 // if there is a valid game rule loaded, break because it is not thought to load multiple game rules 68 break; 69 } 70 else 71 { 72 PRINTF(1)("Could not create a %s\n", element->Value()); 73 delete created; 74 } 75 element = element->NextSiblingElement(); 76 } 77 } 78
Note: See TracChangeset
for help on using the changeset viewer.