Changeset 9348 for code/trunk/src/orxonox/LevelInfo.h
- Timestamp:
- Aug 30, 2012, 11:08:17 PM (12 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:ignore
-
old new 1 .project 1 2 build 2 3 codeblocks 4 dependencies 3 5 vs 4 dependencies
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
code/trunk/src/orxonox/LevelInfo.h
r9016 r9348 43 43 44 44 #include "core/BaseObject.h" 45 #include <iostream> 46 #include <fstream> 45 47 #include "core/OrxonoxClass.h" 46 48 … … 77 79 */ 78 80 inline const std::string& getName(void) const { return this->name_; } // tolua_export 79 81 80 82 /** 81 83 @brief Set the screenshot of the Level. … … 116 118 inline bool hasTag(const std::string& tag) const { return this->tags_.find(tag) != this->tags_.end(); } // tolua_export 117 119 120 void setStartingShips(const std::string& ships); //!< Set the starting ship models of the level 121 bool addStartingShip(const std::string& ship, bool update = true); //!< Add a model to shipselection 122 /** 123 @brief Get the set of starting ship models the Level allows 124 @return Returns a comma-seperated string of all the allowed ship models for the shipselection. 125 */ 126 inline const std::string& getStartingShips(void) const 127 { return this->startingShipsString_; } 128 /** 129 @brief Get whether the Level allows a specific starting ship model 130 @param ship The ship model for which is checked. 131 @return Returns true if the Level allows the input ship model 132 */ 133 inline bool hasStartingShip(const std::string& ship) const { return this->startingShips_.find(ship) != this->startingShips_.end(); } // tolua_export 134 inline void selectStartingShip(const std::string& ship) { this->changeStartingShip(ship); } // tolua_export 118 135 /** 119 136 @brief Get the XML-filename of the Level. … … 122 139 inline const std::string& getXMLFilename(void) const { return this->xmlfilename_; } // tolua_export 123 140 141 124 142 protected: 125 143 /** … … 133 151 134 152 private: 153 void changeStartingShip (const std::string& model); 154 void startingshipsUpdated(void); //!< Updates the comma-seperated string of all possible starting ships. 135 155 void tagsUpdated(void); //!< Updates the comma-seperated string of all tags, if the set of tags has changed. 136 137 156 static void initializeTags(void); //!< Initialize the set of allowed tags. 138 157 /** … … 152 171 std::set<std::string> tags_; //!< The set of tags the Level is tagged with. 153 172 std::string tagsString_; //!< The comma-seperated string of all the tags the Level is tagged with. 173 std::set<std::string> startingShips_; //!< The set of starting ship models the Level allows. 174 std::string startingShipsString_; //!< The comma-seperated string of all the allowed ship models for the shipselection. 154 175 }; // tolua_export 155 176 … … 161 182 - @b description The description of the level. 162 183 - @b screenshot The screenshot of the level. 163 - @b tags A comma-seperated string of tags. Allowed tags are: <em>test</em>, <em>singleplayer</em>, <em>multiplayer</em>, <em>showcase</em>, <em>tutorial</em>, <em>presentation</em> .164 184 - @b tags A comma-seperated string of tags. Allowed tags are: <em>test</em>, <em>singleplayer</em>, <em>multiplayer</em>, <em>showcase</em>, <em>tutorial</em>, <em>presentation</em>, <em>shipselection</em>. 185 - @b (optional) startingships The comma-seperated string of starting ship models 165 186 An example would be: 166 187 @code … … 176 197 @author 177 198 Damian 'Mozork' Frick 178 199 @edit 200 Matthias Hutter 179 201 @ingroup Orxonox 180 202 */ … … 186 208 187 209 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Creates a LevelInfo object through XML. 188 210 189 211 /** 190 212 @brief Set the screenshot of the Level. … … 223 245 inline const std::string& getTags(void) const 224 246 { return this->LevelInfoItem::getTags(); } 247 /** 248 @brief Set the starting ship models of the level 249 @param A comma-seperated string of all the allowed ship models for the shipselection. 250 */ 251 inline void setStartingShips(const std::string& ships) 252 { this->LevelInfoItem::setStartingShips(ships); } 253 /** 254 @brief Get the starting ship models of the level 255 @return Returns a comma-seperated string of all the allowed ship models for the shipselection. 256 */ 257 inline const std::string& getStartingShips(void) const 258 { return this->LevelInfoItem::getStartingShips(); } 225 259 226 260 LevelInfoItem* copy(void); //!< Copies the contents of this LevelInfo object to a new LevelInfoItem object. 227 228 261 }; 229 262 … … 243 276 } 244 277 }; 245 278 246 279 } // tolua_export 247 280
Note: See TracChangeset
for help on using the changeset viewer.