Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 25, 2010, 8:51:17 PM (13 years ago)
Author:
dafrick
Message:

Making the level list in the LevelManager (and as consequence the level list displayed by the GUI) alphabetically sorted. Also some cleanup and documented LevelManager.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/LevelInfo.h

    r7652 r7802  
    4040#include <set>
    4141#include <string>
     42#include "util/StringUtils.h"
    4243
    4344#include "core/BaseObject.h"
     
    7374            @return Returns the name of the Level.
    7475            */
    75             inline const std::string& getName(void) { return this->name_; } // tolua_export
     76            inline const std::string& getName(void) const { return this->name_; } // tolua_export
    7677
    7778            /**
     
    150151        @code
    151152        <LevelInfo
    152             name = "Levelname"
     153            name = "Levelname"lhs->compare(rhs) < 0
    153154            description = "This is just some awesome level."
    154155            tags = "test, awesome"
     
    197198
    198199    };
     200
     201    /**
     202    @brief
     203        Struct that overloads the compare operation between two @ref orxonox::LevelInfoItem "LevelInfoItem" pointers.
     204    */
     205    struct LevelInfoCompare
     206    {
     207        bool operator() (const LevelInfoItem* lhs, const LevelInfoItem* rhs) const
     208            { return getLowercase(lhs->getName()).compare(getLowercase(rhs->getName())) < 0; }
     209    };
     210   
    199211} // tolua_export
    200212
Note: See TracChangeset for help on using the changeset viewer.