Changeset 9313
- Timestamp:
- Jul 8, 2012, 5:33:03 PM (12 years ago)
- Location:
- code/branches/presentation2012merge/src/modules/pickup
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2012merge/src/modules/pickup/Pickup.cc
r9305 r9313 102 102 SUPER(Pickup, XMLPort, xmlelement, mode); 103 103 104 XMLPortParam(Pickup, "activationType", setActivationType , getActivationType, xmlelement, mode);105 XMLPortParam(Pickup, "durationType", setDurationType , getDurationType, xmlelement, mode);104 XMLPortParam(Pickup, "activationType", setActivationTypeAsString, getActivationTypeAsString, xmlelement, mode); 105 XMLPortParam(Pickup, "durationType", setDurationTypeAsString, getDurationTypeAsString, xmlelement, mode); 106 106 107 107 this->initializeIdentifier(); … … 114 114 Returns a string containing the activation type. 115 115 */ 116 const std::string& Pickup::getActivationType (void) const117 { 118 switch(this-> activationType_)116 const std::string& Pickup::getActivationTypeAsString(void) const 117 { 118 switch(this->getActivationType()) 119 119 { 120 120 case pickupActivationType::immediate: … … 133 133 Returns a string containing the duration type. 134 134 */ 135 const std::string& Pickup::getDurationType (void) const136 { 137 switch(this-> durationType_)135 const std::string& Pickup::getDurationTypeAsString(void) const 136 { 137 switch(this->getDurationType()) 138 138 { 139 139 case pickupDurationType::once: … … 152 152 The activation type of the Pickup as a string. 153 153 */ 154 void Pickup::setActivationType (const std::string& type)154 void Pickup::setActivationTypeAsString(const std::string& type) 155 155 { 156 156 if(type == Pickup::activationTypeImmediate_s) 157 this-> activationType_ = pickupActivationType::immediate;157 this->setActivationType(pickupActivationType::immediate); 158 158 else if(type == Pickup::activationTypeOnUse_s) 159 this-> activationType_ = pickupActivationType::onUse;159 this->setActivationType(pickupActivationType::onUse); 160 160 else 161 161 orxout(internal_error, context::pickups) << "Invalid activationType '" << type << "' in " << this->getIdentifier()->getName() << "." << endl; … … 168 168 The duration type of the Pickup as a string. 169 169 */ 170 void Pickup::setDurationType (const std::string& type)170 void Pickup::setDurationTypeAsString(const std::string& type) 171 171 { 172 172 if(type == Pickup::durationTypeOnce_s) 173 this-> durationType_ = pickupDurationType::once;173 this->setDurationType(pickupDurationType::once); 174 174 else if(type == Pickup::durationTypeContinuous_s) 175 this-> durationType_ = pickupDurationType::continuous;175 this->setDurationType(pickupDurationType::continuous); 176 176 else 177 177 orxout(internal_error, context::pickups) << "Invalid durationType '" << type << "' in " << this->getIdentifier()->getName() << "." << endl; … … 206 206 207 207 Pickup* pickup = orxonox_cast<Pickup*>(item); 208 pickup->setActivationType Direct(this->getActivationTypeDirect());209 pickup->setDurationType Direct(this->getDurationTypeDirect());208 pickup->setActivationType(this->getActivationType()); 209 pickup->setDurationType(this->getDurationType()); 210 210 211 211 pickup->initializeIdentifier(); -
code/branches/presentation2012merge/src/modules/pickup/Pickup.h
r8108 r9313 109 109 @return Returns the activation type of the Pickup. 110 110 */ 111 inline pickupActivationType::Value getActivationType Direct(void) const111 inline pickupActivationType::Value getActivationType(void) const 112 112 { return this->activationType_; } 113 113 /** … … 115 115 @return Returns the duration type of the Pickup. 116 116 */ 117 inline pickupDurationType::Value getDurationType Direct(void) const117 inline pickupDurationType::Value getDurationType(void) const 118 118 { return this->durationType_; } 119 119 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.120 const std::string& getActivationTypeAsString(void) const; //!< Get the activation type of the Pickup. 121 const std::string& getDurationTypeAsString(void) const; //!< Get the duration type of the Pickup. 122 122 123 123 /** … … 126 126 */ 127 127 inline bool isImmediate(void) const 128 { return this->getActivationType Direct() == pickupActivationType::immediate; }128 { return this->getActivationType() == pickupActivationType::immediate; } 129 129 /** 130 130 @brief Get whether the activation type is 'onUse'. … … 132 132 */ 133 133 inline bool isOnUse(void) const 134 { return this->getActivationType Direct() == pickupActivationType::onUse; }134 { return this->getActivationType() == pickupActivationType::onUse; } 135 135 /** 136 136 @brief Get whether the duration type is 'once'. … … 138 138 */ 139 139 inline bool isOnce(void) const 140 { return this->getDurationType Direct() == pickupDurationType::once; }140 { return this->getDurationType() == pickupDurationType::once; } 141 141 /** 142 142 @brief Get whether the duration type is 'continuous'. … … 144 144 */ 145 145 inline bool isContinuous(void) const 146 { return this->getDurationType Direct() == pickupDurationType::continuous; }146 { return this->getDurationType() == pickupDurationType::continuous; } 147 147 148 148 virtual void changedPickedUp(void); //!< Should be called when the pickup has transited from picked up to dropped or the other way around. … … 158 158 @param type The activation type of the Pickup. 159 159 */ 160 inline void setActivationType Direct(pickupActivationType::Value type)160 inline void setActivationType(pickupActivationType::Value type) 161 161 { this->activationType_ = type; } 162 162 /** … … 164 164 @param type The duration type of the Pickup. 165 165 */ 166 inline void setDurationType Direct(pickupDurationType::Value type)166 inline void setDurationType(pickupDurationType::Value type) 167 167 { this->durationType_ = type; } 168 168 169 void setActivationType (const std::string& type); //!< Set the activation type of the Pickup.170 void setDurationType (const std::string& type); //!< Set the duration type of the Pickup.169 void setActivationTypeAsString(const std::string& type); //!< Set the activation type of the Pickup. 170 void setDurationTypeAsString(const std::string& type); //!< Set the duration type of the Pickup. 171 171 172 172 private: -
code/branches/presentation2012merge/src/modules/pickup/items/DronePickup.cc
r9312 r9313 75 75 { 76 76 this->addTarget(ClassIdentifier<Pawn>::getIdentifier()); 77 this->setDurationType Direct(pickupDurationType::once);77 this->setDurationType(pickupDurationType::once); 78 78 this->droneTemplate_ = ""; 79 79 } -
code/branches/presentation2012merge/src/modules/pickup/items/MetaPickup.cc
r9312 r9313 80 80 this->addTarget(ClassIdentifier<PickupCarrier>::getIdentifier()); 81 81 82 this->setDurationType Direct(pickupDurationType::once);82 this->setDurationType(pickupDurationType::once); 83 83 this->metaType_ = pickupMetaType::none; 84 84 }
Note: See TracChangeset
for help on using the changeset viewer.