Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 16, 2010, 12:37:09 PM (15 years ago)
Author:
dafrick
Message:

Documenting and cleanup.

File:
1 edited

Legend:

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

    r7493 r7547  
    4040
    4141#include <string>
    42 #include "worldentities/pawns/Pawn.h"
    43 #include "worldentities/StaticEntity.h"
    4442
    4543#include "pickup/Pickup.h"
     
    5149        A Pickup which can add a Shield to the Pawn.
    5250
    53         There are 4 parameters that can be cosen.
    54         - The @b percentage The percentage the shield takes from the damage dealt to a Pawn
    55         - The @b hit @b points The amount of damage points a shield can teake before collapsing
    56         - The @b activation @b type 'immediate' or 'onUse'. defines if the item is used when it's picked up or only after the player chooses to use it.
    57         - The @b duration the activation time of the pickup.
     51        There are 5 parameters that can be cosen.
     52        - The @b shieldhealth< The amount of damage points a shield can take before collapsing. The default is 0.
     53        - The @b shieldabsorption The percentage the shield takes from the damage dealt to a Pawn. The default is 0.
     54        - The @b activationType, <em>immediate</em> or <em>onUse</em>. defines if the ShiedlPickup is used when it's picked up or only after the player chooses to use it. The default is <em>immediate</em>.
     55        - The @b durationType, <em>once</em> means, that the shield will stay until it collapses, <em>continuous</em> means, that the shield only stays for a limited amount of time, specifiey by the duration. The default is <em>once</em>.
     56        - The @b duration the time in seconds the shield is active at the most. The default is 0.
     57
     58        An example of a XML implementation of a ShieldPickup would be:
     59        @code
     60        <ShieldPickup
     61            shieldhealth = 30
     62            shieldabsorption = 0.8
     63            activationType = "immediate"
     64            durationtype = "continuous"
     65            duration = 20.0
     66        />
     67        @endcode
    5868
    5969    @author
    6070        Eric Beier
     71
     72    @ingroup PickupItems
    6173    */
    6274    class _PickupExport ShieldPickup : public Pickup
     
    7284            virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the input OrxonoxClass.
    7385
    74             inline float getDuration(void)
     86            /**
     87            @brief Get the duration, the time the shield is actvie at the most.
     88            @return Returns the duration in seconds.
     89            */
     90            inline float getDuration(void) const
    7591                { return this->duration_; }
    76             inline float getShieldHealth()
     92            /**
     93            @brief Get the shield health, the amount of damage the shield can sustain.
     94            @return Returns the shield health.
     95            */
     96            inline float getShieldHealth() const
    7797                { return this->shieldHealth_; }
    78             inline float getShieldAbsorption()
     98            /**
     99            @brief Get the shield absorption, the percentage of damage that is absorbed by the shield.
     100            @return Returns the shield absorption.
     101            */
     102            inline float getShieldAbsorption() const
    79103                { return this->shieldAbsorption_; }
    80104
    81105        protected:
    82106            void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.
     107            void pickupTimerCallback(void); //!< Helper method. Is called by the Timer as soon as it expires.
    83108
    84             void pickupTimerCallback(void); //!< Function that gets called when timer ends.
    85 
    86             void setDuration(float duration);
    87             void setShieldHealth(float shieldHealth);
    88             void setShieldAbsorption(float shieldAbsorption);
     109            void setDuration(float duration); //!< Sets the duration.
     110            void setShieldHealth(float shieldHealth); //!< Sets the health of the shield.
     111            void setShieldAbsorption(float shieldAbsorption); //!< Sets the percentage the shield absorbs of the dealt damage.
    89112
    90113        private:
     
    95118
    96119            float duration_; //!< The health that is transferred to the Pawn.
    97             float shieldHealth_;
    98             float shieldAbsorption_; // Has to be between 0 and 1
     120            float shieldHealth_; //!< The amount of damage the shield can sustain.
     121            float shieldAbsorption_; //!< The percentage of damage that is absorbed by the shield.
    99122
    100123    };
Note: See TracChangeset for help on using the changeset viewer.