Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 9, 2009, 3:21:12 AM (15 years ago)
Author:
landauf
Message:

added TeamGametype

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/miniprojects/src/orxonox/objects/Level.cc

    r2710 r2768  
    105105    {
    106106        Identifier* identifier = ClassByString(gametype);
    107         if (identifier && identifier->isA(Class(Gametype)))
     107
     108        if (!identifier || !identifier->isA(Class(Gametype)))
    108109        {
     110            COUT(0) << "Error: \"" << gametype << "\" is not a valid gametype." << std::endl;
     111            identifier = Class(Gametype);
     112            this->gametype_ = "Gametype";
     113        }
     114        else
    109115            this->gametype_ = gametype;
    110116
    111             Gametype* rootgametype = dynamic_cast<Gametype*>(identifier->fabricate(this));
    112             this->setGametype(rootgametype);
     117std::cout << "Load Gametype: " << this->gametype_ << std::endl;
    113118
    114             for (std::list<BaseObject*>::iterator it = this->objects_.begin(); it != this->objects_.end(); ++it)
    115                 (*it)->setGametype(rootgametype);
     119        Gametype* rootgametype = dynamic_cast<Gametype*>(identifier->fabricate(this));
     120        this->setGametype(rootgametype);
    116121
    117             if (LevelManager::getInstancePtr())
    118                 LevelManager::getInstance().requestActivity(this);
    119         }
     122std::cout << "root gametype: " << rootgametype->getIdentifier()->getName() << std::endl;
     123
     124        for (std::list<BaseObject*>::iterator it = this->objects_.begin(); it != this->objects_.end(); ++it)
     125            (*it)->setGametype(rootgametype);
     126
     127        if (LevelManager::getInstancePtr())
     128            LevelManager::getInstance().requestActivity(this);
    120129    }
    121130
Note: See TracChangeset for help on using the changeset viewer.