Changeset 6419 for code/branches/pickup3/src/orxonox/pickup/items
- Timestamp:
- Dec 25, 2009, 11:07:09 PM (15 years ago)
- Location:
- code/branches/pickup3
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pickup3
- Property svn:mergeinfo changed
/code/branches/pickup2 (added) merged: 5942,5947,5953,6405
- Property svn:mergeinfo changed
-
code/branches/pickup3/src/orxonox/pickup/items/HealthImmediate.cc
r5929 r6419 59 59 } 60 60 61 //TODO: Should be destroyed anyways... 61 62 bool HealthImmediate::pickedUp(Pawn* pawn) 62 63 { -
code/branches/pickup3/src/orxonox/pickup/items/HealthImmediate.h
r5781 r6419 45 45 class _OrxonoxExport HealthImmediate : public PassiveItem 46 46 { 47 public: 48 HealthImmediate(BaseObject* creator); 49 virtual ~HealthImmediate(); 47 //TODO: Comment. 48 //Does this get destroyed, when the healt is delivered? It seems to me it doesn't. 49 public: 50 HealthImmediate(BaseObject* creator); 51 virtual ~HealthImmediate(); 50 52 51 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);53 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 52 54 53 virtual bool pickedUp(Pawn* pawn);55 virtual bool pickedUp(Pawn* pawn); 54 56 55 inline float getRecoveredHealth() const56 { return this->recoveredHealth_; }57 inline void setRecoveredHealth(float recovery)58 { this->recoveredHealth_ = recovery; }57 inline float getRecoveredHealth() const 58 { return this->recoveredHealth_; } 59 inline void setRecoveredHealth(float recovery) 60 { this->recoveredHealth_ = recovery; } 59 61 60 private:61 float recoveredHealth_;62 private: 63 float recoveredHealth_; 62 64 }; 63 65 } -
code/branches/pickup3/src/orxonox/pickup/items/HealthUsable.cc
r5929 r6419 45 45 46 46 /** 47 48 47 @brief Constructor 48 @param creator Object that created this item. 49 49 */ 50 50 HealthUsable::HealthUsable(BaseObject* creator) : UsableItem(creator) … … 54 54 this->recoveredHealth_ = 0; 55 55 } 56 56 57 //! Deconstructor 57 58 HealthUsable::~HealthUsable() 58 59 { 59 60 } 61 60 62 /** 61 62 63 63 @brief XMLPort for Jump. 64 @param xmlelement Element of the XML-file. 65 @param mode XMLPort mode to use. 64 66 */ 65 67 void HealthUsable::XMLPort(Element& xmlelement, XMLPort::Mode mode) … … 69 71 XMLPortParam(HealthUsable, "recoveredHealth", setRecoveredHealth, getRecoveredHealth, xmlelement, mode); 70 72 } 73 71 74 /** 72 73 75 @brief Called when the item is used, makes the user "jump". 76 @param pawn Pawn which used te item. 74 77 */ 78 //TODO: Jump? Nope! => Comment. 79 //Should be destroyed anyways. 75 80 void HealthUsable::used(Pawn* pawn) 76 81 { … … 85 90 } 86 91 } 92 87 93 /** 88 89 94 @brief Called when the item is picked up. 95 @param pawn Pawn which picked up the item. 90 96 */ 91 97 bool HealthUsable::pickedUp(Pawn* pawn) … … 93 99 return this->addTo(pawn); 94 100 } 101 95 102 /** 96 97 103 @brief Called when the item is dropped, creates a DroppedItem behind the pawn. 104 @param pawn Pawn which dropped the item. 98 105 */ 99 106 bool HealthUsable::dropped(Pawn* pawn) -
code/branches/pickup3/src/orxonox/pickup/items/Jump.h
r5781 r6419 50 50 class _OrxonoxExport Jump : public UsableItem 51 51 { 52 public: 53 Jump(BaseObject* creator); //!< Constructor 54 virtual ~Jump(); //!< Deconstructor 52 public: 53 //TODO: Comment. a.s.o. 54 Jump(BaseObject* creator); //!< Constructor 55 virtual ~Jump(); //!< Deconstructor 55 56 56 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< XMLPort57 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< XMLPort 57 58 58 virtual int getMaxCarryAmount() const59 { return INT_MAX; }59 virtual int getMaxCarryAmount() const 60 { return INT_MAX; } 60 61 61 virtual void used(Pawn* pawn); //!< Called when the item is used.62 virtual void used(Pawn* pawn); //!< Called when the item is used. 62 63 63 virtual bool pickedUp(Pawn* pawn); //!< Called when the item is picked up.64 virtual bool dropped(Pawn* pawn); //!< Called when the item is dropped.64 virtual bool pickedUp(Pawn* pawn); //!< Called when the item is picked up. 65 virtual bool dropped(Pawn* pawn); //!< Called when the item is dropped. 65 66 66 /**67 @brief Get the velocity added when the item is used.68 @return Returns the added velocity (relative to the Pawn).69 */70 inline const Vector3& getVelocity() const71 { return this->velocity_; }72 /**73 @brief Set the velocity added when the item is used.74 @param velocity New added velocity (relative to Pawn).75 */76 inline void setVelocity(const Vector3& velocity)77 { this->velocity_ = velocity; }78 /**79 @brief Get the amount of jumps available.80 @return Returns how many times the item can be used.81 */82 inline int getJumpsAvailable() const83 { return this->jumpsAvailable_; }84 /**85 @brief Set the amount of jumps available.86 @param num New number of available jumps.87 */88 inline void setJumpsAvailable(int num)89 { this->jumpsAvailable_ = num; }90 private:91 Vector3 velocity_; //!< The velocity added when the item is used.92 int jumpsAvailable_; //!< Amount of jumps still available.67 /** 68 @brief Get the velocity added when the item is used. 69 @return Returns the added velocity (relative to the Pawn). 70 */ 71 inline const Vector3& getVelocity() const 72 { return this->velocity_; } 73 /** 74 @brief Set the velocity added when the item is used. 75 @param velocity New added velocity (relative to Pawn). 76 */ 77 inline void setVelocity(const Vector3& velocity) 78 { this->velocity_ = velocity; } 79 /** 80 @brief Get the amount of jumps available. 81 @return Returns how many times the item can be used. 82 */ 83 inline int getJumpsAvailable() const 84 { return this->jumpsAvailable_; } 85 /** 86 @brief Set the amount of jumps available. 87 @param num New number of available jumps. 88 */ 89 inline void setJumpsAvailable(int num) 90 { this->jumpsAvailable_ = num; } 91 private: 92 Vector3 velocity_; //!< The velocity added when the item is used. 93 int jumpsAvailable_; //!< Amount of jumps still available. 93 94 }; 94 95 }
Note: See TracChangeset
for help on using the changeset viewer.