Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 11, 2010, 11:21:28 AM (14 years ago)
Author:
dafrick
Message:

Adding restriction to possible tags.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/releasetodo/src/orxonox/LevelInfo.cc

    r7626 r7638  
    4242
    4343    // LevelInfoItem
     44   
     45    //! The list of allowed tags.
     46    /*static*/ std::set<std::string> LevelInfoItem::possibleTags_s = std::set<std::string>();
    4447
    4548    /**
     
    7376    {
    7477
     78    }
     79   
     80    void LevelInfoItem::initializeTags(void)
     81    {
     82        if(!LevelInfoItem::initialized_s)
     83        {
     84            LevelInfoItem::possibleTags_s.insert("test");
     85            LevelInfoItem::possibleTags_s.insert("singleplayer");
     86            LevelInfoItem::possibleTags_s.insert("multiplayer");
     87            LevelInfoItem::possibleTags_s.insert("showcase");
     88            LevelInfoItem::possibleTags_s.insert("tutorial");
     89        }
    7590    }
    7691
     
    103118    bool LevelInfoItem::addTag(const std::string& tag, bool update)
    104119    {
     120        if(!this->validateTag(tag))
     121        {
     122            COUT(2) << "Bad tag '" << tag << "' in " << this->getXMLFilename() << ". Ignoring..." << std::endl;
     123            return false;
     124        }
    105125        bool success = this->tags_.insert(std::string(tag)).second;
    106126        if(update && success)
Note: See TracChangeset for help on using the changeset viewer.