Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 5, 2010, 6:26:54 PM (14 years ago)
Author:
dafrick
Message:

Additional documentation, code niceifying and potential bug fixing. Also: Renamed DroppedItem to DroppedPickup.

File:
1 edited

Legend:

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

    r6474 r6475  
    2828
    2929#ifndef _Pickup_H__
    30 #define Pickup_H__
     30#define _Pickup_H__
    3131
    3232#include "pickup/PickupPrereqs.h"
    3333
    34 #include "interfaces/Pickupable.h"
    3534#include "core/BaseObject.h"
    3635#include "core/XMLPort.h"
     36
     37#include "interfaces/Pickupable.h"
    3738
    3839namespace orxonox
     
    5960    }
    6061   
     62    /**
     63    @brief
     64        Pickup class. Offers base functionality for a wide range of pickups.
     65        Pickups ingeriting from this class cann choose an activation type and a duration type.
     66    @author
     67        Damian 'Mozork' Frick
     68    */
    6169    class _PickupExport Pickup : public Pickupable, public BaseObject
    6270    {
    6371       
    6472        public:
    65            
    66             Pickup(BaseObject* creator);
    67             virtual ~Pickup();
     73            Pickup(BaseObject* creator); //!< Constructor.
     74            virtual ~Pickup(); //!< Destructor.
    6875           
    6976            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     
    8592            const std::string& getDurationType(void); //!< Get the duration type of the pickup.
    8693           
     94            /**
     95            @brief Get whether the activation type is 'immediate'.
     96            @return Returns true if the activation type is 'immediate'.
     97            */
    8798            inline bool isImmediate(void)
    8899                { return this->getActivationTypeDirect() == pickupActivationType::immediate; }
     100            /**
     101            @brief Get whether the activation type is 'onUse'.
     102            @return Returns true if the activation type is 'onUse'.
     103            */
    89104            inline bool isOnUse(void)
    90105                { return this->getActivationTypeDirect() == pickupActivationType::onUse; }
     106            /**
     107            @brief Get whether the duration type is 'once'.
     108            @return Returns true if the duration type is 'once'.
     109            */
    91110            inline bool isOnce(void)
    92111                { return this->getDurationTypeDirect() == pickupDurationType::once; }
     112            /**
     113            @brief Get whether the duration type is 'continuous'.
     114            @return Returns true if the duration type is 'continuous'.
     115            */
    93116            inline bool isContinuous(void)
    94117                { return this->getDurationTypeDirect() == pickupDurationType::continuous; }
    95                        
    96             virtual void clone(OrxonoxClass* item);
    97118           
    98             virtual void changedCarrier(void);
     119            virtual void changedCarrier(void); //!< Should be called when the pickup has transited from picked up to dropped or the other way around.
     120                                   
     121            virtual void clone(OrxonoxClass* item); //!< Creates a duplicate of the Pickup.
    99122               
    100123        protected:
    101124            void initializeIdentifier(void);
     125           
     126            virtual bool createSpawner(const Vector3& position); //!< Facilitates the creation of a PickupSpawner upon dropping of the Pickupable.
    102127           
    103128            /**
     
    118143               
    119144        private:
     145            void initialize(void); //!< Initializes the member variables.
     146           
    120147            pickupActivationType::Value activationType_; //!< The activation type of the Pickup.
    121148            pickupDurationType::Value durationType_; //!< The duration type of the pickup.
     
    125152            static const std::string durationTypeOnce_s;
    126153            static const std::string durationTypeContinuous_s;
    127             static const std::string blankString_s; //TODO: Maybe already implemented somewhere?
    128154       
    129155    };
Note: See TracChangeset for help on using the changeset viewer.