Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 30, 2012, 11:08:17 PM (12 years ago)
Author:
landauf
Message:

merged branch presentation2012merge back to trunk

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/LevelInfo.h

    r9016 r9348  
    4343
    4444#include "core/BaseObject.h"
     45#include <iostream>
     46#include <fstream>
    4547#include "core/OrxonoxClass.h"
    4648
     
    7779            */
    7880            inline const std::string& getName(void) const { return this->name_; } // tolua_export
    79        
     81
    8082            /**
    8183            @brief Set the screenshot of the Level.
     
    116118            inline bool hasTag(const std::string& tag) const { return this->tags_.find(tag) != this->tags_.end(); } // tolua_export
    117119
     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
    118135            /**
    119136            @brief Get the XML-filename of the Level.
     
    122139            inline const std::string& getXMLFilename(void) const { return this->xmlfilename_; } // tolua_export
    123140
     141
    124142        protected:
    125143            /**
     
    133151
    134152        private:
     153            void changeStartingShip (const std::string& model);
     154            void startingshipsUpdated(void); //!< Updates the comma-seperated string of all possible starting ships.
    135155            void tagsUpdated(void); //!< Updates the comma-seperated string of all tags, if the set of tags has changed.
    136 
    137156            static void initializeTags(void); //!< Initialize the set of allowed tags.
    138157            /**
     
    152171            std::set<std::string> tags_; //!< The set of tags the Level is tagged with.
    153172            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.
    154175    }; // tolua_export
    155176
     
    161182        - @b description The description of the level.
    162183        - @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
    165186        An example would be:
    166187        @code
     
    176197    @author
    177198        Damian 'Mozork' Frick
    178 
     199    @edit
     200        Matthias Hutter
    179201    @ingroup Orxonox
    180202    */
     
    186208
    187209            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Creates a LevelInfo object through XML.
    188        
     210
    189211            /**
    190212            @brief Set the screenshot of the Level.
     
    223245            inline const std::string& getTags(void) const
    224246                { 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(); }
    225259
    226260            LevelInfoItem* copy(void); //!< Copies the contents of this LevelInfo object to a new LevelInfoItem object.
    227 
    228261    };
    229262
     
    243276            }
    244277    };
    245    
     278
    246279} // tolua_export
    247280
Note: See TracChangeset for help on using the changeset viewer.