Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 13, 2005, 11:16:33 PM (19 years ago)
Author:
bensch
Message:

orxonox/branches/physics: merged the Trunk into the physics Branche again:
merged with command:
svn merge ../trunk physics -r 3953:HEAD
no important conflicts

Location:
orxonox/branches/physics
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/physics

    • Property svn:externals
      •  

        old new  
        1 data http://svn.orxonox.ethz.ch/data
         1
  • orxonox/branches/physics/src/story_entities/campaign.cc

    r3832 r4178  
    1919#include "campaign.h"
    2020
     21#include "game_loader.h"
    2122#include "story_entity.h"
    2223
     
    3435  this->isInit = false;
    3536}
    36 
     37Campaign::Campaign ( TiXmlElement* root)
     38{
     39  TiXmlElement* element;
     40  const char* string;
     41  int id;
     42 
     43  PRINTF(3)("Loading Campaign...\n");
     44 
     45  assert( root != NULL);
     46  GameLoader* loader = GameLoader::getInstance();
     47 
     48  this->entities = new tList<StoryEntity>();
     49  this->isInit = false;
     50 
     51  // grab all the necessary parameters
     52  string = grabParameter( root, "identifier");
     53  if( string == NULL || sscanf(string, "%d", &id) != 1)
     54    {
     55      PRINTF(2)("Campaign is missing a proper 'identifier'\n");
     56      this->setStoryID( -1);
     57    }
     58  else this->setStoryID( id);
     59 
     60  // find WorldList
     61  element = root->FirstChildElement( "WorldList");
     62  if( element == NULL)
     63    {
     64      PRINTF(2)("Campaign is missing a proper 'WorldList'\n");
     65    }
     66  else
     67    element = element->FirstChildElement();
     68 
     69  // load Worlds/Subcampaigns/Whatever
     70  StoryEntity* lastCreated = NULL;
     71  while( element != NULL)
     72    {
     73      printf("Campaign: Constructor: adding a world\n");
     74      StoryEntity* created = (StoryEntity*) loader->fabricate( element);
     75      /*
     76      if( lastCreated != NULL)
     77        created->setNextStoryID( lastCreated->getStoryID());
     78      else
     79        created->setNextStoryID( WORLD_ID_GAMEEND);
     80      */
     81      if( created != NULL)
     82        {
     83          this->addEntity( created);   
     84          lastCreated = created;
     85        }
     86      element = element->NextSiblingElement();
     87    }
     88  //if( lastCreated != NULL)
     89  //lastCreated->setStoryID( WORLD_ID_GAMEEND);
     90}
    3791
    3892Campaign::~Campaign () {}
Note: See TracChangeset for help on using the changeset viewer.