Changeset 7547 for code/trunk/src/modules/pickup/Pickup.h
- Timestamp:
- Oct 16, 2010, 12:37:09 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/pickup/Pickup.h
r7533 r7547 40 40 #include "core/BaseObject.h" 41 41 #include "core/XMLPort.h" 42 #include "tools/Timer.h" 42 43 43 44 #include "CollectiblePickup.h" 44 45 #include "tools/Timer.h"46 45 47 46 namespace orxonox … … 83 82 84 83 Pickups ingeriting from this class can choose an activation type and a duration type. 85 - 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.86 - 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.84 - The <b>activationType</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. Default is <em>immediate</em>. 85 - The <b>durationType</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. Default is <em>once</em>. 87 86 88 87 If it were not an abstract class it could for example be used as follows in XML. … … 110 109 @return Returns the activation type of the Pickup. 111 110 */ 112 inline pickupActivationType::Value getActivationTypeDirect(void) 111 inline pickupActivationType::Value getActivationTypeDirect(void) const 113 112 { return this->activationType_; } 114 113 /** … … 116 115 @return Returns the duration type of the Pickup. 117 116 */ 118 inline pickupDurationType::Value getDurationTypeDirect(void) 117 inline pickupDurationType::Value getDurationTypeDirect(void) const 119 118 { return this->durationType_; } 120 119 121 const std::string& getActivationType(void) ; //!< Get the activation type of the Pickup.122 const std::string& getDurationType(void) ; //!< Get the duration type of the Pickup.120 const std::string& getActivationType(void) const; //!< Get the activation type of the Pickup. 121 const std::string& getDurationType(void) const; //!< Get the duration type of the Pickup. 123 122 124 123 /** … … 126 125 @return Returns true if the activation type is 'immediate'. 127 126 */ 128 inline bool isImmediate(void) 127 inline bool isImmediate(void) const 129 128 { return this->getActivationTypeDirect() == pickupActivationType::immediate; } 130 129 /** … … 132 131 @return Returns true if the activation type is 'onUse'. 133 132 */ 134 inline bool isOnUse(void) 133 inline bool isOnUse(void) const 135 134 { return this->getActivationTypeDirect() == pickupActivationType::onUse; } 136 135 /** … … 138 137 @return Returns true if the duration type is 'once'. 139 138 */ 140 inline bool isOnce(void) 139 inline bool isOnce(void) const 141 140 { return this->getDurationTypeDirect() == pickupDurationType::once; } 142 141 /** … … 144 143 @return Returns true if the duration type is 'continuous'. 145 144 */ 146 inline bool isContinuous(void) 145 inline bool isContinuous(void) const 147 146 { return this->getDurationTypeDirect() == pickupDurationType::continuous; } 148 147 149 148 virtual void changedPickedUp(void); //!< Should be called when the pickup has transited from picked up to dropped or the other way around. 150 151 149 virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the OrxonoxClass. 152 150
Note: See TracChangeset
for help on using the changeset viewer.