Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Documenting and cleanup.

File:
1 edited

Legend:

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

    r7493 r7547  
    3939
    4040#include <string>
    41 #include "worldentities/pawns/Pawn.h"
    42 #include "worldentities/StaticEntity.h"
    4341
    4442#include "pickup/Pickup.h"
     
    5048        A Pickup which can manipulate the Speed of a Pawn.
    5149
    52         There are 4 parameters that can be cosen:
    53         - The @b speed @b multiplier
    54         - The @b additional (forward) @b speed
    55         - 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.
    56         - The @b duration The activation time of the pickup.
     50        There are 5 parameters that can be cosen:
     51        - The @b speedMultiply, specifies a factor by which the Spaceships speed is multiplied. The default is 1.
     52        - The @b speedAdd, specifies a value that is added to the speed of the Spaceship. The default is 0.
     53        - The @b activationType <em>immediate</em> or <em>onUse</em>, defines if the SpeedPickup is used when it's picked up or only after the player chooses to use it. The default is <em>immediate</em>.
     54        - The @b durationType Can be either <em>once</em> or <em>continuous</em>. For <em>once</em> the SpeedPickup is just active for as long as it is used, for <em>continuous</em> the SpeedPickup is active only for the specified duration. The default is <em>once</em>.
     55        - The @b duration The time in seconds the SpeedPickup is active at the most. The default is 0.
     56
     57        An example, how a SpeedPickup could be defined in XML could be:
     58        @code
     59        <SpeedPickup
     60            speedMultiply = 2.0
     61            speedAdd = 10.0
     62            activationType = "immediate"
     63            durationType = "continuous"
     64            duration = 30.0
     65        />
     66        @endcode
    5767
    5868    @author
    5969        Eric Beier
     70
     71    @ingroup PickupItems
    6072    */
    6173    class _PickupExport SpeedPickup : public Pickup
     
    7183            virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the input OrxonoxClass.
    7284
    73             inline float getDuration(void)
     85            /**
     86            @brief Get the duration, the time the SpeedPickup is active.
     87            @return Returns the duration in seconds.
     88            */
     89            inline float getDuration(void) const
    7490                { return this->duration_; }
    75             inline float getSpeedAdd(void)
     91            /**
     92            @brief Get the value that is added to the speed of the Pawn.
     93            @return Returns the speedAdd.
     94            */
     95            inline float getSpeedAdd(void) const
    7696                { return this->speedAdd_; }
    77             inline float getSpeedMultiply(void)
     97            /**
     98            @brief Get the factor by wich the speed of the Pawn is multplied.
     99            @return Returns the speedMultiply.
     100            */
     101            inline float getSpeedMultiply(void) const
    78102                { return this->speedMultiply_; }
    79103
    80104        protected:
    81105            void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.
    82 
    83106            void pickupTimerCallback(void); //!< Function that gets called when timer ends.
    84107
    85             void setDuration(float duration);
    86             void setSpeedAdd(float speedAdd);
    87             void setSpeedMultiply(float speedMultiply);
     108            void setDuration(float duration); //!< Sets the duration.
     109            void setSpeedAdd(float speedAdd); //!< Sets the SpeedAdd, the value that is added to the speed of the Pawn.
     110            void setSpeedMultiply(float speedMultiply); //!< Sets the speedMultiply, the factor by which the speed of the Pawn is multiplied.
    88111
    89112        private:
     
    93116            Timer durationTimer_; //!< Timer.
    94117
    95             float duration_; //!< The health that is transferred to the Pawn.
    96             float speedAdd_;
    97             float speedMultiply_;
     118            float duration_; //!< The time in seconds for which the SpeedPickup stays active.
     119            float speedAdd_; //!< The value that is added to the speed of the Pawn.
     120            float speedMultiply_; //!< The factor by which the speed of the Pawn is multiplied.
    98121    };
    99122}
Note: See TracChangeset for help on using the changeset viewer.