Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 23, 2012, 4:24:24 PM (13 years ago)
Author:
huttemat
Message:

test2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/shipSelection/src/orxonox/LevelInfo.h

    r9016 r9057  
    2424 *   Co-authors:
    2525 *      ...
    26  *
     26 *   
    2727 */
    2828
     
    115115            */
    116116            inline bool hasTag(const std::string& tag) const { return this->tags_.find(tag) != this->tags_.end(); } // tolua_export
    117 
     117 
     118            void setShips(const std::string& ships); //!< Set the starting ship models of the level
     119            bool addShip(const std::string& ship, bool update = true); //!< Add a model to shipselection
     120            /**
     121            @brief Get the set of starting ship models the Level allows
     122            @return Returns a comma-seperated string of all the allowed ship models for the shipselection.
     123            */
     124            inline const std::string& getShips(void) const
     125                { return this->startingShipsString_; }   
     126            /**
     127            @brief Get whether the Level allows a specific starting ship model
     128            @param ship The ship model for which is checked.
     129            @return Returns true if the Level allows the input ship model
     130            */
     131            inline bool hasShip(const std::string& ship) const { return this->ships_.find(ship) != this->ships_.end(); } // tolua_export       
    118132            /**
    119133            @brief Get the XML-filename of the Level.
    120134            @return Returns the XML-filename (including *.oxw extension) of the Level.
    121135            */
     136
    122137            inline const std::string& getXMLFilename(void) const { return this->xmlfilename_; } // tolua_export
    123138
     
    134149        private:
    135150            void tagsUpdated(void); //!< Updates the comma-seperated string of all tags, if the set of tags has changed.
    136 
     151            void shipsUpdated(void); //!< Updates the comma-seperated string of all tags, if the set of tags has changed.
    137152            static void initializeTags(void); //!< Initialize the set of allowed tags.
    138153            /**
     
    152167            std::set<std::string> tags_; //!< The set of tags the Level is tagged with.
    153168            std::string tagsString_; //!< The comma-seperated string of all the tags the Level is tagged with.
     169            std::set<std::string> ships_; //!< The set of starting ship models the Level allows.
     170            std::string startingShipsString_; //!< The comma-seperated string of all the allowed ship models for the shipselection.           
    154171    }; // tolua_export
    155172
     
    161178        - @b description The description of the level.
    162179        - @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 
     180        - @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>.
     181        - @b (optional) startingships The comma-seperated string of starting ship models
    165182        An example would be:
    166183        @code
     
    176193    @author
    177194        Damian 'Mozork' Frick
    178 
     195        @edit
     196                Matthias Hutter
    179197    @ingroup Orxonox
    180198    */
     
    223241            inline const std::string& getTags(void) const
    224242                { return this->LevelInfoItem::getTags(); }
    225 
     243            /**
     244            @brief Set the starting ship models of the level
     245            @param A comma-seperated string of all the allowed ship models for the shipselection.
     246            */
     247            inline void setShips(const std::string& ships)
     248                { this->LevelInfoItem::setShips(ships); }
     249            /**
     250            @brief Get the starting ship models of the level
     251            @return Returns a comma-seperated string of all the allowed ship models for the shipselection.
     252            */
     253            inline const std::string& getShips(void) const
     254                { return this->LevelInfoItem::getShips(); }             
    226255            LevelInfoItem* copy(void); //!< Copies the contents of this LevelInfo object to a new LevelInfoItem object.
    227 
    228256    };
    229257
Note: See TracChangeset for help on using the changeset viewer.