- Timestamp:
- Jul 21, 2012, 6:16:19 PM (12 years ago)
- Location:
- code/branches/presentation2012merge/src/modules/pickup/items
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2012merge/src/modules/pickup/items/ShrinkPickup.cc
r9320 r9321 91 91 XMLPortParam(ShrinkPickup, "duration", setDuration, getDuration, xmlelement, mode); 92 92 XMLPortParam(ShrinkPickup, "shrinkDuration", setShrinkDuration, getShrinkDuration, xmlelement, mode); 93 } 94 95 /** 96 @brief Sets the shrinking factor. 97 @param factor The factor, needs to greater than 1. 98 */ 99 void ShrinkPickup::setShrinkFactor(float factor) 100 { 101 if(factor <= 1.0f) 102 { 103 orxout(internal_warning, context::pickups) << "Invalid shrinking factor in ShrinkPickup. Ignoring.." << endl; 104 return; 105 } 106 this->shrinkFactor_ = factor; 107 } 108 109 /** 110 @brief Set the duration for which the ship remains shrunken. 111 @param duration The duration, needs to be non-negative. 112 */ 113 void ShrinkPickup::setDuration(float duration) 114 { 115 if(duration < 0.0f) 116 { 117 orxout(internal_warning, context::pickups) << "Invalid duration in ShrinkPickup. Ignoring.." << endl; 118 return; 119 } 120 this->duration_ = duration; 121 } 122 123 /** 124 @brief Set the shrink duration. 125 @param speed The shrink duration, needs to be positive. 126 */ 127 void ShrinkPickup::setShrinkDuration(float speed) 128 { 129 if(speed <= 0.0f) 130 { 131 orxout(internal_warning, context::pickups) << "Invalid shrink duration in ShrinkPickup. Ignoring.." << endl; 132 return; 133 } 134 this->shrinkDuration_ = speed; 93 135 } 94 136 -
code/branches/presentation2012merge/src/modules/pickup/items/ShrinkPickup.h
r9320 r9321 87 87 inline float getShrinkFactor(void) const 88 88 { return this->shrinkFactor_; } 89 /** 90 @brief Sets the shrinking factor. 91 @param factor The factor, needs to greater than 1. 92 */ 93 inline void setShrinkFactor(float factor) 94 { if(factor <= 1.0f) { orxout(internal_warning, context::pickups) << "Invalid shrinking factor in ShrinkPickup. Ignoring.." << endl; return; } this->shrinkFactor_ = factor; } 89 void setShrinkFactor(float factor); 90 95 91 /** 96 92 @brief Get the duration for which the ship remains shrunken. … … 99 95 inline float getDuration(void) const 100 96 { return this->duration_; } 101 /** 102 @brief Set the duration for which the ship remains shrunken. 103 @param duration The duration, needs to be non-negative. 104 */ 105 inline void setDuration(float duration) 106 { if(duration < 0.0f) { orxout(internal_warning, context::pickups) << "Invalid duration in ShrinkPickup. Ignoring.." << endl; return; } this->duration_ = duration; } 97 void setDuration(float duration); 98 107 99 /** 108 100 @brief Get the shrink speed. … … 111 103 inline float getShrinkDuration(void) const 112 104 { return this->shrinkDuration_; } 113 /** 114 @brief Set the shrink duration. 115 @param speed The shrink duration, needs to be positive. 116 */ 117 inline void setShrinkDuration(float speed) 118 { if(speed <= 0.0f) { orxout(internal_warning, context::pickups) << "Invalid shrink duration in ShrinkPickup. Ignoring.." << endl; return; } this->shrinkDuration_ = speed; } 105 void setShrinkDuration(float speed); 119 106 120 107 private:
Note: See TracChangeset
for help on using the changeset viewer.