Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 6, 2011, 11:26:12 PM (14 years ago)
Author:
dafrick
Message:

Making LevelInfoCompare a strictly weak ordering (compared to just a weak ordering, which is not a good idea for sets), which leads to no more warnings because of levels that have the same name. Which is ok, imo, als long as the LevelManager can distinguish them, which it can as long as they don't have the sime filenames as well.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/usability/src/orxonox/LevelInfo.h

    r7804 r8037  
    109109            @return Returns the XML-filename (including *.oxw extension) of the Level.
    110110            */
    111             inline const std::string& getXMLFilename(void) { return this->xmlfilename_; } // tolua_export
     111            inline const std::string& getXMLFilename(void) const { return this->xmlfilename_; } // tolua_export
    112112
    113113        protected:
     
    212212    {
    213213        bool operator() (const LevelInfoItem* lhs, const LevelInfoItem* rhs) const
    214             { return getLowercase(lhs->getName()).compare(getLowercase(rhs->getName())) < 0; }
     214            {
     215                if(getLowercase(lhs->getName()).compare(getLowercase(rhs->getName())) == 0)
     216                    return getLowercase(lhs->getXMLFilename()).compare(getLowercase(rhs->getXMLFilename())) < 0;
     217                return getLowercase(lhs->getName()).compare(getLowercase(rhs->getName())) < 0;
     218            }
    215219    };
    216220   
Note: See TracChangeset for help on using the changeset viewer.