- Timestamp:
- Jul 18, 2012, 10:36:24 PM (12 years ago)
- Location:
- code/branches/presentation2012merge/src/modules/pickup/items
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2012merge/src/modules/pickup/items/DamageBoostPickup.cc
r9305 r9318 38 38 #include "core/XMLPort.h" 39 39 40 #include "pickup/PickupIdentifier.h"41 40 #include "worldentities/pawns/SpaceShip.h" 42 41 … … 78 77 /** 79 78 @brief 80 Initializes the PickupIdentifier of this pickup.81 */82 void DamageBoostPickup::initializeIdentifier(void)83 {84 this->pickupIdentifier_->addParameter("duration", this->getDuration());85 this->pickupIdentifier_->addParameter("damageMultiplier", this->getDamageMultiplier());86 }87 88 /**89 @brief90 79 Method for creating a DamageBoostPickup object through XML. 91 80 */ … … 96 85 XMLPortParam(DamageBoostPickup, "duration", setDuration, getDuration, xmlelement, mode); 97 86 XMLPortParam(DamageBoostPickup, "damageMultiplier", setDamageMultiplier, getDamageMultiplier, xmlelement, mode); 98 99 this->initializeIdentifier();100 87 } 101 88 … … 196 183 pickup->setDuration(this->getDuration()); 197 184 pickup->setDamageMultiplier(this->getDamageMultiplier()); 198 pickup->initializeIdentifier();199 185 } 200 186 -
code/branches/presentation2012merge/src/modules/pickup/items/DamageBoostPickup.h
r9272 r9318 79 79 80 80 protected: 81 void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.82 81 void setDamageMultiplier(float damageMultiplier); //!< Sets the DamageMultiplier according to the XML. 83 82 -
code/branches/presentation2012merge/src/modules/pickup/items/DronePickup.cc
r9313 r9318 39 39 40 40 #include "controllers/DroneController.h" 41 #include "pickup/PickupIdentifier.h"42 41 #include "worldentities/Drone.h" 43 42 #include "worldentities/pawns/Pawn.h" … … 81 80 /** 82 81 @brief 83 Initializes the PickupIdentifier of this pickup.84 */85 void DronePickup::initializeIdentifier(void)86 {87 this->pickupIdentifier_->addParameter("droneTemplate", this->getDroneTemplate());88 }89 90 /**91 @brief92 82 Method for creating a DronePickup object through XML. 93 83 */ … … 96 86 SUPER(DronePickup, XMLPort, xmlelement, mode); 97 87 XMLPortParam(DronePickup, "droneTemplate", setDroneTemplate, getDroneTemplate, xmlelement, mode); 98 99 this->initializeIdentifier();100 88 } 101 89 … … 198 186 DronePickup* pickup = orxonox_cast<DronePickup*>(item); 199 187 pickup->setDroneTemplate(this->getDroneTemplate()); 200 201 pickup->initializeIdentifier();202 188 } 203 189 } -
code/branches/presentation2012merge/src/modules/pickup/items/DronePickup.h
r9312 r9318 75 75 76 76 protected: 77 void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.78 79 77 void setDroneTemplate(const std::string& templatename); //!< Set the droneTemplate. 80 78 -
code/branches/presentation2012merge/src/modules/pickup/items/HealthPickup.cc
r9312 r9318 38 38 #include "core/XMLPort.h" 39 39 40 #include "pickup/PickupIdentifier.h"41 40 #include "worldentities/pawns/Pawn.h" 42 41 … … 87 86 /** 88 87 @brief 89 Initializes the PickupIdentifier of this pickup.90 */91 void HealthPickup::initializeIdentifier(void)92 {93 this->pickupIdentifier_->addParameter("health", this->getHealth());94 this->pickupIdentifier_->addParameter("healthType", this->getHealthType());95 this->pickupIdentifier_->addParameter("healthRate", this->getHealthRate());96 }97 98 /**99 @brief100 88 Method for creating a HealthPickup object through XML. 101 89 */ … … 110 98 if(!this->isContinuous()) 111 99 this->setHealthRate(0.0f); // TODO: this logic should be inside tick(), not in XMLPort 112 113 this->initializeIdentifier();114 100 } 115 101 … … 277 263 pickup->setHealthRate(this->getHealthRate()); 278 264 pickup->setHealthType(this->getHealthType()); 279 280 pickup->initializeIdentifier();281 265 } 282 266 -
code/branches/presentation2012merge/src/modules/pickup/items/HealthPickup.h
r9312 r9318 121 121 122 122 protected: 123 void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.124 125 123 void setHealth(float health); //!< Sets the health. 126 124 void setHealthRate(float speed); //!< Set the rate at which health is transferred if the pickup is continuous. -
code/branches/presentation2012merge/src/modules/pickup/items/InvisiblePickup.cc
r9305 r9318 40 40 #include "core/XMLPort.h" 41 41 42 #include "pickup/PickupIdentifier.h"43 42 #include "worldentities/pawns/Pawn.h" 44 43 … … 79 78 /** 80 79 @brief 81 Initializes the PickupIdentifier of this pickup.82 */83 void InvisiblePickup::initializeIdentifier(void)84 {85 this->pickupIdentifier_->addParameter("duration", this->getDuration());86 }87 88 /**89 @brief90 80 Method for creating a HealthPickup object through XML. 91 81 */ … … 94 84 SUPER(InvisiblePickup, XMLPort, xmlelement, mode); 95 85 XMLPortParam(InvisiblePickup, "duration", setDuration, getDuration, xmlelement, mode); 96 97 this->initializeIdentifier();98 86 } 99 87 … … 157 145 InvisiblePickup* pickup = orxonox_cast<InvisiblePickup*>(item); 158 146 pickup->setDuration(this->getDuration()); 159 pickup->initializeIdentifier();160 147 } 161 148 -
code/branches/presentation2012merge/src/modules/pickup/items/InvisiblePickup.h
r7547 r9318 72 72 InvisiblePickup(BaseObject* creator); //!< Constructor. 73 73 virtual ~InvisiblePickup(); //!< Destructor. 74 74 75 75 virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode); //!< Method for creating a HealthPickup object through XML. 76 76 virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around. … … 91 91 92 92 protected: 93 void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.94 95 93 bool setInvisible(bool invisibility); //!< Set the Pawn to be invisible or visible again. 96 94 void setDuration(float duration); //!< Sets the time the InvisibilityPickup will last. -
code/branches/presentation2012merge/src/modules/pickup/items/MetaPickup.cc
r9313 r9318 36 36 37 37 #include "interfaces/PickupCarrier.h" 38 #include "pickup/PickupIdentifier.h"39 38 #include "worldentities/pawns/Pawn.h" 40 39 … … 86 85 /** 87 86 @brief 88 Helper method to initialize the PickupIdentifier.89 */90 void MetaPickup::initializeIdentifier(void)91 {92 this->pickupIdentifier_->addParameter("metaType", this->getMetaType());93 }94 95 /**96 @brief97 87 Method for creating a MetaPickup object through XML. 98 88 */ … … 102 92 103 93 XMLPortParam(MetaPickup, "metaType", setMetaTypeAsString, getMetaTypeAsString, xmlelement, mode); 104 105 this->initializeIdentifier();106 94 } 107 95 … … 172 160 MetaPickup* pickup = orxonox_cast<MetaPickup*>(item); 173 161 pickup->setMetaType(this->getMetaType()); 174 175 pickup->initializeIdentifier();176 162 } 177 163 -
code/branches/presentation2012merge/src/modules/pickup/items/MetaPickup.h
r9312 r9318 106 106 107 107 protected: 108 void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.109 110 108 /** 111 109 @brief Set the meta type of the MetaPickup. -
code/branches/presentation2012merge/src/modules/pickup/items/ShieldPickup.cc
r9305 r9318 38 38 #include "core/XMLPort.h" 39 39 40 #include "pickup/PickupIdentifier.h"41 40 #include "worldentities/pawns/Pawn.h" 42 41 … … 80 79 /** 81 80 @brief 82 Initializes the PickupIdentifier of this pickup.83 */84 void ShieldPickup::initializeIdentifier(void)85 {86 this->pickupIdentifier_->addParameter("duration", this->getDuration());87 this->pickupIdentifier_->addParameter("ShieldHealth", this->getShieldHealth());88 this->pickupIdentifier_->addParameter("ShieldAbsorption", this->getShieldAbsorption());89 }90 91 /**92 @brief93 81 Method for creating a ShieldPickup object through XML. 94 82 */ … … 100 88 XMLPortParam(ShieldPickup, "shieldabsorption", setShieldAbsorption, getShieldAbsorption, xmlelement, mode); 101 89 XMLPortParam(ShieldPickup, "duration", setDuration, getDuration, xmlelement, mode); 102 103 this->initializeIdentifier();104 90 } 105 91 … … 188 174 pickup->setShieldAbsorption(this->getShieldAbsorption()); 189 175 pickup->setShieldHealth(this->getShieldHealth()); 190 pickup->initializeIdentifier();191 176 } 192 177 -
code/branches/presentation2012merge/src/modules/pickup/items/ShieldPickup.h
r7547 r9318 104 104 105 105 protected: 106 void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.107 106 void pickupTimerCallback(void); //!< Helper method. Is called by the Timer as soon as it expires. 108 107 -
code/branches/presentation2012merge/src/modules/pickup/items/ShrinkPickup.cc
r9305 r9318 40 40 #include "core/XMLPort.h" 41 41 42 #include "pickup/PickupIdentifier.h"43 42 #include "worldentities/pawns/Pawn.h" 44 43 … … 81 80 } 82 81 83 void ShrinkPickup::initializeIdentifier(void)84 {85 this->pickupIdentifier_->addParameter("shrinkFactor", this->getShrinkFactor());86 this->pickupIdentifier_->addParameter("duration", this->getDuration());87 this->pickupIdentifier_->addParameter("shrinkDuration", this->getShrinkDuration());88 }89 90 82 /** 91 83 @brief … … 99 91 XMLPortParam(ShrinkPickup, "duration", setDuration, getDuration, xmlelement, mode); 100 92 XMLPortParam(ShrinkPickup, "shrinkDuration", setShrinkDuration, getShrinkDuration, xmlelement, mode); 101 102 this->initializeIdentifier();103 93 } 104 94 … … 321 311 pickup->setDuration(this->getDuration()); 322 312 pickup->setShrinkDuration(this->getShrinkDuration()); 323 324 pickup->initializeIdentifier();325 313 } 326 314 } -
code/branches/presentation2012merge/src/modules/pickup/items/ShrinkPickup.h
r8858 r9318 119 119 { if(speed <= 0.0f) { orxout(internal_warning, context::pickups) << "Invalid shrink duration in ShrinkPickup. Ignoring.." << endl; return; } this->shrinkDuration_ = speed; } 120 120 121 protected:122 void initializeIdentifier(void);123 124 121 private: 125 122 void initialize(void); … … 135 132 float currentFactor_; //!< The shrink factor that is currently applied. 136 133 float timeRemainig_; //!< The remaining shrink time. 137 134 138 135 Pawn* carrierToPawnHelper(void); 139 136 Timer durationTimer_; -
code/branches/presentation2012merge/src/modules/pickup/items/SpeedPickup.cc
r9305 r9318 38 38 #include "core/XMLPort.h" 39 39 40 #include "pickup/PickupIdentifier.h"41 40 #include "worldentities/pawns/SpaceShip.h" 42 41 … … 80 79 /** 81 80 @brief 82 Initializes the PickupIdentifier of this pickup.83 */84 void SpeedPickup::initializeIdentifier(void)85 {86 this->pickupIdentifier_->addParameter("duration", this->getDuration());87 this->pickupIdentifier_->addParameter("speedAdd", this->getSpeedAdd());88 this->pickupIdentifier_->addParameter("speedMultiply", this->getSpeedMultiply());89 }90 91 /**92 @brief93 81 Method for creating a SpeedPickup object through XML. 94 82 */ … … 100 88 XMLPortParam(SpeedPickup, "speedAdd", setSpeedAdd, getSpeedAdd, xmlelement, mode); 101 89 XMLPortParam(SpeedPickup, "speedMultiply", setSpeedMultiply, getSpeedMultiply, xmlelement, mode); 102 103 this->initializeIdentifier();104 90 } 105 91 … … 189 175 pickup->setSpeedAdd(this->getSpeedAdd()); 190 176 pickup->setSpeedMultiply(this->getSpeedMultiply()); 191 192 pickup->initializeIdentifier();193 177 } 194 178 -
code/branches/presentation2012merge/src/modules/pickup/items/SpeedPickup.h
r9269 r9318 103 103 104 104 protected: 105 void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.106 105 void pickupTimerCallback(void); //!< Function that gets called when timer ends. 107 106
Note: See TracChangeset
for help on using the changeset viewer.