Changeset 6475 for code/branches/pickup3/src/modules/pickup/Pickup.h
- Timestamp:
- Mar 5, 2010, 6:26:54 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pickup3/src/modules/pickup/Pickup.h
r6474 r6475 28 28 29 29 #ifndef _Pickup_H__ 30 #define Pickup_H__30 #define _Pickup_H__ 31 31 32 32 #include "pickup/PickupPrereqs.h" 33 33 34 #include "interfaces/Pickupable.h"35 34 #include "core/BaseObject.h" 36 35 #include "core/XMLPort.h" 36 37 #include "interfaces/Pickupable.h" 37 38 38 39 namespace orxonox … … 59 60 } 60 61 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 */ 61 69 class _PickupExport Pickup : public Pickupable, public BaseObject 62 70 { 63 71 64 72 public: 65 66 Pickup(BaseObject* creator); 67 virtual ~Pickup(); 73 Pickup(BaseObject* creator); //!< Constructor. 74 virtual ~Pickup(); //!< Destructor. 68 75 69 76 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); … … 85 92 const std::string& getDurationType(void); //!< Get the duration type of the pickup. 86 93 94 /** 95 @brief Get whether the activation type is 'immediate'. 96 @return Returns true if the activation type is 'immediate'. 97 */ 87 98 inline bool isImmediate(void) 88 99 { 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 */ 89 104 inline bool isOnUse(void) 90 105 { 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 */ 91 110 inline bool isOnce(void) 92 111 { 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 */ 93 116 inline bool isContinuous(void) 94 117 { return this->getDurationTypeDirect() == pickupDurationType::continuous; } 95 96 virtual void clone(OrxonoxClass* item);97 118 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. 99 122 100 123 protected: 101 124 void initializeIdentifier(void); 125 126 virtual bool createSpawner(const Vector3& position); //!< Facilitates the creation of a PickupSpawner upon dropping of the Pickupable. 102 127 103 128 /** … … 118 143 119 144 private: 145 void initialize(void); //!< Initializes the member variables. 146 120 147 pickupActivationType::Value activationType_; //!< The activation type of the Pickup. 121 148 pickupDurationType::Value durationType_; //!< The duration type of the pickup. … … 125 152 static const std::string durationTypeOnce_s; 126 153 static const std::string durationTypeContinuous_s; 127 static const std::string blankString_s; //TODO: Maybe already implemented somewhere?128 154 129 155 };
Note: See TracChangeset
for help on using the changeset viewer.