- Timestamp:
- Aug 8, 2010, 8:53:52 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation3/src/orxonox/interfaces/Pickupable.h
r7150 r7162 95 95 virtual void changedPickedUp(void) {} 96 96 97 bool pickup(PickupCarrier* carrier); 98 bool drop(bool createSpawner = true); 97 /** 98 @brief Returns whether the Pickupable can be used. 99 @return Returns true if it can be used. 100 */ 101 inline bool isUsable(void) { return this->enabled_; } // tolua_export 102 103 /** 104 @brief Returns whether the Pickupable can be unused. 105 @return Returns true if it can be unused. 106 */ 107 inline bool isUnusable(void) { return this->enabled_; } // tolua_export 108 109 /** 110 @brief Returns whether the Pickupable is enabled. 111 Once a Pickupable is disabled it cannot be enabled again. A Pickupable that is disabled can neither be used nor unused. 112 @return Returns true if the Pickupable is enabled. 113 */ 114 inline bool isEnabled(void) 115 { return this->enabled_; } 116 117 bool pickup(PickupCarrier* carrier); //!< Can be called to pick up a Pickupable. 118 bool drop(bool createSpawner = true); //!< Can be called to drop a Pickupable. 99 119 100 120 virtual bool isTarget(PickupCarrier* carrier) const; //!< Get whether the given PickupCarrier is a target of this pickup. … … 115 135 bool setUsed(bool used); //!< Sets the Pickupable to used or unused, depending on the input. 116 136 bool setPickedUp(bool pickedUp); //!< Helper method to set the Pickupable to either picked up or not picked up. 117 bool setCarrier(PickupCarrier* carrier, bool tell = false); //!< Sets the carrier of the pickup. 137 //TODO: private? 138 bool setCarrier(PickupCarrier* carrier, bool tell = true); //!< Sets the carrier of the pickup. 139 140 //TODO: private? 141 virtual void carrierDestroyed(void); //!< Is called by the PickupCarrier when it is being destroyed. 142 143 void destroy(void); //!< Is called internally within the pickup module to destroy pickups. 118 144 119 145 protected: … … 122 148 */ 123 149 void initializeIdentifier(void) {} 150 151 virtual void preDestroy(void); //!< A method that is called by OrxonoxClass::destroy() before the object is actually destroyed. 152 virtual void destroyPickup(void); //!< Destroys a Pickupable. 153 154 /** 155 @brief Sets the Pickuapble to disabled. 156 */ 157 inline void setDisabled(void) 158 { this->enabled_ = false; } 124 159 125 160 /** … … 136 171 private: 137 172 138 bool used_; //!< Whether the pickupis currently in use or not.139 bool pickedUp_; //!< Whether the pickupis currently picked up or not.173 bool used_; //!< Whether the Pickupable is currently in use or not. 174 bool pickedUp_; //!< Whether the Pickupable is currently picked up or not. 140 175 141 PickupCarrier* carrier_; //!< The carrier of the pickup. 142 std::list<Identifier*> targets_; //!< The possible targets of this pickup. 176 bool enabled_; //!< Whether the Pickupable is enabled or not. 177 178 PickupCarrier* carrier_; //!< The PickupCarrier of the Pickupable. 179 std::list<Identifier*> targets_; //!< The possible targets of this Pickupable. 180 181 bool beingDestroyed_; //!< Is true if the Pickupable is in the process of being destroyed. 143 182 144 183 // For implementing the Rewardable interface:
Note: See TracChangeset
for help on using the changeset viewer.