Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 11, 2005, 5:28:38 PM (20 years ago)
Author:
chris
Message:

orxonox/branches/levelloader: Feeble attempt to load anything… neither finished nor useful

Location:
orxonox/branches/levelloader/src/story_entities
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/levelloader/src/story_entities/campaign.cc

    r3499 r3501  
    3333Campaign::~Campaign () {}
    3434
     35Campaign::Campaign ( TiXMLElement* root)
     36{
     37        TiXMLElement* element;
     38       
     39        assert( root != NULL);
     40        GameLoader* loader = GameLoader::getInstance();
     41       
     42  this->entities = new ListTemplate<StoryEntity>();
     43  this->isInit = false;
     44 
     45  // grab all the necessary parameters
     46 
     47  // find WorldList
     48  element = root->FirstChildElement( "WorldList");
     49 
     50  // load Worlds
     51        while( element != NULL)
     52        {
     53                StoryEntity created = loader->fabricate( element);
     54                if( created != NULL) addEntity( created);
     55                element = element->nextSiblingElement();
     56        }
     57}
    3558
    3659ErrorMessage Campaign::init()
  • orxonox/branches/levelloader/src/story_entities/campaign.h

    r3499 r3501  
    11
    2 #ifndef _CAMPAIGN_H
     2#ifndef _CAMPAIGN_HCREATE_FACTORY
    33#define _CAMPAIGN_H
    44
     
    1313 public:
    1414  Campaign ();
     15  Campaign ( TiXMLElement* root);
    1516  ~Campaign ();
    1617
     
    4041};
    4142
     43CREATE_FACTORY(Campaign);
     44
    4245#endif /* _CAMPAIGN_H */
  • orxonox/branches/levelloader/src/story_entities/story_entity.h

    r3499 r3501  
    1616 public:
    1717  StoryEntity ();
     18  StoryEntity ( TiXMLElement* root) {};
    1819  virtual ~StoryEntity ();
    1920
  • orxonox/branches/levelloader/src/story_entities/world.cc

    r3499 r3501  
    3232using namespace std;
    3333
     34
     35World::World( TiXMLElement* root)
     36{
     37        TiXMLElement* element;
     38        // load parameters
     39                // identifier
     40        element = FirstChildrenElement("identifier");
     41        if( element == NULL)
     42        {
     43                PRINTF(ERR)("World created with missing identifier\n");
     44                setStoryID( -1);
     45        }
     46                // file
     47}
    3448
    3549/**
  • orxonox/branches/levelloader/src/story_entities/world.h

    r3499 r3501  
    2828
    2929 public:
     30        World (TiXMLElement* root),
    3031  World (char* name);
    3132  World (int worldID);
     
    8889};
    8990
     91CREATE_FACTORY(World);
     92
    9093#endif /* _WORLD_H */
Note: See TracChangeset for help on using the changeset viewer.