Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7036 in orxonox.OLD for trunk/src


Ignore:
Timestamp:
Feb 5, 2006, 11:54:39 PM (19 years ago)
Author:
patrick
Message:

trunk: the game rules are now loadable

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/Makefile.am

    r7033 r7036  
    3232                lib/graphics/effects/fog_effect.cc \
    3333                lib/graphics/effects/lense_flare.cc \
     34                \
     35                util/multiplayer_team_deathmatch.cc \
    3436                \
    3537                subprojects/benchmark.cc
  • trunk/src/story_entities/game_world_data.cc

    r7035 r7036  
    1515
    1616#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD
     17
     18#include <fstream>
     19#include <iostream>
    1720
    1821#include "game_world_data.h"
     
    365368void GameWorldData::loadGameRule(const TiXmlElement* root)
    366369{
    367 
    368   const TiXmlElement* element = root->FirstChildElement("GameRule");
    369 
    370   if( element == NULL)
    371   {
    372     PRINTF(1)("GameWorld is missing 'GameRule'\n");
    373   }
    374   else
    375   {
    376     element = element->FirstChildElement();
    377 
    378     while( element != NULL)
     370  const TiXmlElement* element = root->FirstChildElement();
     371  while( element != NULL)
     372  {
     373    PRINTF(4)("creating %s\n", element->Value());
     374    BaseObject* created = Factory::fabricate(element);
     375    if (created != NULL /*&& created->isA(CL_GAME_RULES)*/)
    379376    {
    380       BaseObject* created = Factory::fabricate(element);
    381       if (created == NULL /*|| !created->isA(CL_GAME_RULE)*/)
    382         delete created;
    383       else
    384       {
    385         this->gameRule = dynamic_cast<GameRules*>(created);
    386         element = element->NextSiblingElement();
    387       }
     377      this->gameRule = dynamic_cast<GameRules*>(created);
    388378    }
    389   }
    390 
    391 
    392 
    393 }
    394 
    395 
    396 
     379    else
     380    {
     381      PRINTF(1)("Could not create a %s\n", element->Value());
     382      delete created;
     383    }
     384    element = element->NextSiblingElement();
     385  }
     386}
     387
     388
     389
Note: See TracChangeset for help on using the changeset viewer.