Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 28, 2010, 5:31:59 PM (14 years ago)
Author:
dafrick
Message:

Some documenting and cleaning up/re-organization in pickups module.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/modules/pickup/Pickup.h

    r7456 r7494  
    4848{
    4949
    50     //! Enum for the activation type.
     50    //! Enum for the @ref orxonox::Pickup "Pickup" activation type.
    5151    namespace pickupActivationType
    5252    {
    5353        enum Value
    5454        {
    55             immediate,
    56             onUse,
     55            immediate, //!< Means that the @ref orxonox::Pickup "Pickup" will be used immediately after pickup.
     56            onUse, //!< Means that the @ref orxonox::Pickup "Pickup" will be used at a later point trough some external influence.
    5757        };
    5858    }
    5959
    60     //! Enum for the duration tyoe.
     60    //! Enum for the @ref orxonox::Pickup "Pickup" duration type.
    6161    namespace pickupDurationType
    6262    {
    6363        enum Value
    6464        {
    65             once,
    66             continuous,
     65            once, //!< Means that the @ref orxonox::Pickup "Pickup" will be used only once at a singular time instant.
     66            continuous, //!< Means that the @ref orxonox::Pickup "Pickup" will be used over a continuous timespan.
    6767        };
    6868    }
     
    7070    /**
    7171    @brief
    72         Pickup class. Offers base functionality for a wide range of pickups.
    73         Pickups ingeriting from this class cann choose an activation type and a duration type.
     72        The Pickup class offers (useful) base functionality for a wide range of pickups.
     73
     74        Pickups ingeriting from this class can choose an activation type and a duration type.
     75        - The <b>activation type</b> deals with what happens to the Pickup as soon as it is picked up. It can either be set to <em>immediate</em>, which means that the Pickup is activated/used immediately upon being picked up. Or to <em>onUse</em>, which means, that the Pickup will be activated/used if some outside entity (most commonly the player through the PickupInventory) decides to use it.
     76        - The <b>duration type</b> deals with whether the Pickup has a continuous effect or whether its effect is focused on a singular instant. It can either be set to <em>once</em>, which means, that the Pickup just has an effect (at a singular instant in time) and is done once that effect has been applied. Or to <em>continuous</em>, which means that the effect of the Pickup unfolds over some timespan.
     77
     78        If it were not an abstract class it could for example be used as follows in XML.
     79        @code
     80        <Pickup activationType="onUse" durationType="continuous" />
     81        @endcode
     82        In reality you can (naturally) use the parameters <b>activation type</b> and <b>duration type</b> in any pickup inheriting from Pickup, unless the pickup already specifies one (or both) of the parameters.
     83
    7484    @author
    7585        Damian 'Mozork' Frick
     
    8595
    8696            /**
    87             @brief Get the activation type of the pickup.
    88             @return Returns the activation type of the pickup.
     97            @brief Get the activation type of the Pickup.
     98            @return Returns the activation type of the Pickup.
    8999            */
    90100            inline pickupActivationType::Value getActivationTypeDirect(void)
    91101                { return this->activationType_; }
    92102            /**
    93             @brief Get the duration type of the pickup.
    94             @return Returns the duration type of the pickup.
     103            @brief Get the duration type of the Pickup.
     104            @return Returns the duration type of the Pickup.
    95105            */
    96106            inline pickupDurationType::Value getDurationTypeDirect(void)
    97107                { return this->durationType_; }
    98108
    99             const std::string& getActivationType(void); //!< Get the activation type of the pickup.
    100             const std::string& getDurationType(void); //!< Get the duration type of the pickup.
     109            const std::string& getActivationType(void); //!< Get the activation type of the Pickup.
     110            const std::string& getDurationType(void); //!< Get the duration type of the Pickup.
    101111
    102112            /**
     
    127137            virtual void changedPickedUp(void); //!< Should be called when the pickup has transited from picked up to dropped or the other way around.
    128138
    129             virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the Pickup.
     139            virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the OrxonoxClass.
    130140
    131141        protected:
     
    135145
    136146            /**
    137             @brief Set the activation type of the pickup.
    138             @param type The activation type of the pickup.
     147            @brief Set the activation type of the Pickup.
     148            @param type The activation type of the Pickup.
    139149            */
    140150            inline void setActivationTypeDirect(pickupActivationType::Value type)
    141151                { this->activationType_ = type; }
    142152            /**
    143             @brief Set the duration type of the pickup.
    144             @param type The duration type of the pickup.
     153            @brief Set the duration type of the Pickup.
     154            @param type The duration type of the Pickup.
    145155            */
    146156            inline void setDurationTypeDirect(pickupDurationType::Value type)
    147157                { this->durationType_ = type; }
    148158
    149             void setActivationType(const std::string& type); //!< Set the activation type of the pickup.
    150             void setDurationType(const std::string& type); //!< Set the duration type of the pickup
     159            void setActivationType(const std::string& type); //!< Set the activation type of the Pickup.
     160            void setDurationType(const std::string& type); //!< Set the duration type of the Pickup.
    151161
    152162        private:
     
    154164
    155165            pickupActivationType::Value activationType_; //!< The activation type of the Pickup.
    156             pickupDurationType::Value durationType_; //!< The duration type of the pickup.
     166            pickupDurationType::Value durationType_; //!< The duration type of the Pickup.
    157167
    158168            //! Strings for the activation and duration types.
Note: See TracChangeset for help on using the changeset viewer.