Changeset 7494 for code/trunk/src/modules/pickup/Pickup.h
- Timestamp:
- Sep 28, 2010, 5:31:59 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/pickup/Pickup.h
r7456 r7494 48 48 { 49 49 50 //! Enum for the activation type.50 //! Enum for the @ref orxonox::Pickup "Pickup" activation type. 51 51 namespace pickupActivationType 52 52 { 53 53 enum Value 54 54 { 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. 57 57 }; 58 58 } 59 59 60 //! Enum for the duration tyoe.60 //! Enum for the @ref orxonox::Pickup "Pickup" duration type. 61 61 namespace pickupDurationType 62 62 { 63 63 enum Value 64 64 { 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. 67 67 }; 68 68 } … … 70 70 /** 71 71 @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 74 84 @author 75 85 Damian 'Mozork' Frick … … 85 95 86 96 /** 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. 89 99 */ 90 100 inline pickupActivationType::Value getActivationTypeDirect(void) 91 101 { return this->activationType_; } 92 102 /** 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. 95 105 */ 96 106 inline pickupDurationType::Value getDurationTypeDirect(void) 97 107 { return this->durationType_; } 98 108 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. 101 111 102 112 /** … … 127 137 virtual void changedPickedUp(void); //!< Should be called when the pickup has transited from picked up to dropped or the other way around. 128 138 129 virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the Pickup.139 virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the OrxonoxClass. 130 140 131 141 protected: … … 135 145 136 146 /** 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. 139 149 */ 140 150 inline void setActivationTypeDirect(pickupActivationType::Value type) 141 151 { this->activationType_ = type; } 142 152 /** 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. 145 155 */ 146 156 inline void setDurationTypeDirect(pickupDurationType::Value type) 147 157 { this->durationType_ = type; } 148 158 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 pickup159 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. 151 161 152 162 private: … … 154 164 155 165 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. 157 167 158 168 //! Strings for the activation and duration types.
Note: See TracChangeset
for help on using the changeset viewer.