Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 23, 2005, 11:37:25 AM (19 years ago)
Author:
chris
Message:

orxonox/branches/ll2trunktemp: I tried… Not working…

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/ll2trunktemp/src/game_loader.cc

    r3727 r3940  
    230230    this->currentCampaign->previousLevel();
    231231}
     232
     233/**
     234   \brief add a Factory to the Factory Q
     235   \param factory a Factory to be registered
     236*/
     237void GameLoader::registerFactory( Factory* factory)
     238{
     239        assert( factory != NULL);
     240       
     241        PRINTF0("Registered factory for '%s'\n", factory->getClassname());
     242       
     243        if( first == NULL) first = factory;
     244        else first->registerFactory( factory);
     245}
     246
     247/**
     248   \brief load a StoryEntity
     249   \param element a XMLElement containing all the needed info
     250*/
     251BaseObject* GameLoader::fabricate( TiXmlElement* element)
     252{
     253        assert( element != NULL);
     254       
     255        if( first == NULL)
     256        {
     257                PRINTF0("GameLoader does not know any factories, fabricate() failed\n");
     258                return NULL;
     259        }
     260       
     261        if( element->Value() != NULL)
     262        {
     263                PRINTF0("Attempting fabrication of a '%s'\n", element->Value());
     264                BaseObject* b = first->fabricate( element);
     265                if( b == NULL) PRINTF0("Failed to fabricate a '%s'\n", element->Value());
     266                else PRINTF0("Successfully fabricated a '%s'\n", element->Value());
     267                return b;
     268        }
     269       
     270        PRINTF0("Fabricate failed, TiXmlElement did not contain a value\n");
     271       
     272        return NULL;
     273}
Note: See TracChangeset for help on using the changeset viewer.