Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8037


Ignore:
Timestamp:
Mar 6, 2011, 11:26:12 PM (13 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.

Location:
code/branches/usability/src/orxonox
Files:
2 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   
  • code/branches/usability/src/orxonox/LevelManager.h

    r7804 r8037  
    112112            // Helpers to allow fast access to the availableLevels list.
    113113            unsigned int nextIndex_; //! The next expected index to be accessed.
    114             std::set<LevelInfoItem*, LevelInfoCompare>::iterator nextLevel_; //! The nex expected Level to be accessed.
     114            std::set<LevelInfoItem*, LevelInfoCompare>::iterator nextLevel_; //! The next expected Level to be accessed.
    115115
    116116            // config values
Note: See TracChangeset for help on using the changeset viewer.