- Timestamp:
- Jun 9, 2010, 9:32:58 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation3/src/modules/pickup/items/HealthPickup.h
r6709 r7127 45 45 46 46 namespace orxonox { 47 47 48 48 //! Enum for the type of the HealthPickup 49 49 namespace pickupHealthType … … 56 56 }; 57 57 } 58 58 59 59 /** 60 60 @brief … … 71 71 { 72 72 public: 73 73 74 74 HealthPickup(BaseObject* creator); //!< Constructor. 75 75 virtual ~HealthPickup(); //!< Destructor. 76 76 77 77 virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode); //!< Method for creating a HealthPickup object through XML. 78 78 virtual void tick(float dt); //!< Is called every tick. 79 79 80 80 virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around. 81 81 virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the input OrxonoxClass. 82 82 83 83 /** 84 84 @brief Get the health that is transfered to the Pawn upon usage of this pickup. … … 93 93 inline float getHealthRate(void) 94 94 { return this->healthRate_; } 95 95 96 96 /** 97 97 @brief Get the type of HealthPickup, this pickup is. 98 @return Returns the health type as an enum. 98 @return Returns the health type as an enum. 99 99 */ 100 100 inline pickupHealthType::Value getHealthTypeDirect(void) 101 101 { return this->healthType_; } 102 102 const std::string& getHealthType(void); //!< Get the health type of this pickup. 103 103 104 104 protected: 105 105 void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup. … … 107 107 void setHealth(float health); //!< Sets the health. 108 108 void setHealthRate(float speed); //!< Set the rate at which health is transferred if the pickup is continuous. 109 109 110 110 /** 111 111 @brief Set the health type of this pickup. … … 115 115 { this->healthType_ = type; } 116 116 void setHealthType(std::string type); //!< Set the type of the HealthPickup. 117 117 118 118 private: 119 119 void initialize(void); //!< Initializes the member variables. 120 120 Pawn* carrierToPawnHelper(void); //!< Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails. 121 121 122 122 float health_; //!< The health that is transferred to the Pawn. 123 123 float healthRate_; //!< The rate at which the health is transferred. … … 125 125 float maxHealthOverwrite_; //!< Helper to remember with which value we overwrote the maxHealh, to detect if someone else changed it as well. 126 126 pickupHealthType::Value healthType_; //!< The type of the HealthPickup. 127 127 128 128 //! Strings for the health types. 129 129 static const std::string healthTypeLimited_s; 130 130 static const std::string healthTypeTemporary_s; 131 131 static const std::string healthTypePermanent_s; 132 132 133 133 }; 134 134 }
Note: See TracChangeset
for help on using the changeset viewer.