Changeset 7802 for code/trunk/src/orxonox/LevelManager.h
- Timestamp:
- Dec 25, 2010, 8:51:17 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/LevelManager.h
r7648 r7802 23 23 * Fabian 'x3n' Landau 24 24 * Co-authors: 25 * ...25 * Damian 'Mozork' Frick 26 26 * 27 27 */ … … 37 37 #include <string> 38 38 39 #include "LevelInfo.h" 40 39 41 #include "util/Singleton.h" 40 42 #include "core/OrxonoxClass.h" … … 43 45 namespace orxonox 44 46 { 47 48 /** 49 @brief 50 The LevelManager keeps track of @ref orxonox::Level "Levels" whose activity has been requested and serves as an access point to get a list of all available @ref orxonox::Level "Levels" (or rather their respective @ref orxonox::LevelInfoItem "LevelInfoItems"). 51 52 @author 53 Fabian 'x3n' Landau 54 55 @author 56 Damian 'Mozork' Frick 57 */ 45 58 class _OrxonoxExport LevelManager 46 59 // tolua_end … … 52 65 virtual ~LevelManager(); 53 66 54 void setConfigValues(); 67 void setConfigValues(); //!< Set the config values for this object. 55 68 56 void requestActivity(Level* level); 57 void releaseActivity(Level* level); 58 Level* getActiveLevel(); 69 void requestActivity(Level* level); //!< Request activity for the input Level. 70 void releaseActivity(Level* level); //!< Release activity for the input Level. 71 Level* getActiveLevel(); //!< Get the currently active Level. 59 72 60 void setDefaultLevel(const std::string& levelName); //tolua_export 61 const std::string& getDefaultLevel() const; //tolua_export 62 unsigned int getNumberOfLevels(void); //tolua_export 63 LevelInfoItem* getAvailableLevelListItem(unsigned int index) const; //tolua_export 73 // tolua_begin 74 void setDefaultLevel(const std::string& levelName); //!< Set the default Level. 75 /** 76 @brief Get the default level. 77 @return Returns the filename of the default level. 78 */ 79 const std::string& getDefaultLevel() const 80 { return defaultLevelName_; } 81 unsigned int getNumberOfLevels(void); 82 LevelInfoItem* getAvailableLevelListItem(unsigned int index); //!< Get the LevelInfoItem at the given index in the list of available Levels. 64 83 65 static LevelManager& getInstance() { return Singleton<LevelManager>::getInstance(); } // tolua_export 84 /** 85 @brief Get the instance of the LevelManager. 86 @return Returns the instance of the LevelManager. 87 */ 88 static LevelManager& getInstance() 89 { return Singleton<LevelManager>::getInstance(); } 90 // tolua_end 66 91 67 92 private: 68 93 LevelManager(const LevelManager&); 69 94 70 void activateNextLevel(); 95 void activateNextLevel(); //!< Activate the next level. 71 96 72 void compileAvailableLevelList(void); 73 void updateAvailableLevelList(void); 97 void compileAvailableLevelList(void); //!< Compile the list of available Levels. 98 void updateAvailableLevelList(void); //!< Update the list of available Levels. 74 99 75 std::list<Level*> levels_s; 76 std::vector<std::string> availableLevels_; 77 std::map<std::string, LevelInfoItem*> infos_; 100 std::list<Level*> levels_; //!< A list of all the Levels whose activity has been requested, in the order in which they will become active. 101 std::set<LevelInfoItem*, LevelInfoCompare> availableLevels_; //!< The set of available Levels sorted alphabetically according to the name of the Level. 102 103 // Helpers to allow fast access to the availableLevels list. 104 unsigned int nextIndex_; //! The next expected index to be accessed. 105 std::set<LevelInfoItem*, LevelInfoCompare>::iterator nextLevel_; //! The nex expected Level to be accessed. 78 106 79 107 // config values
Note: See TracChangeset
for help on using the changeset viewer.