- Timestamp:
- Jul 18, 2012, 10:36:24 PM (12 years ago)
- Location:
- code/branches/presentation2012merge/src/orxonox/interfaces
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2012merge/src/orxonox/interfaces/Pickupable.cc
r9293 r9318 39 39 40 40 #include "infos/PlayerInfo.h" 41 #include "pickup/PickupIdentifier.h"42 41 #include "worldentities/pawns/Pawn.h" 43 42 … … 52 51 Constructor. Registers the objects and initializes its member variables. 53 52 */ 54 Pickupable::Pickupable() : pickupIdentifier_(NULL),used_(false), pickedUp_(false)53 Pickupable::Pickupable() : used_(false), pickedUp_(false) 55 54 { 56 55 RegisterRootObject(Pickupable); … … 58 57 this->carrier_ = NULL; 59 58 60 this->pickupIdentifier_ = new PickupIdentifier(this);61 59 this->beingDestroyed_ = false; 62 60 this->enabled_ = true; … … 69 67 Pickupable::~Pickupable() 70 68 { 71 if(this->pickupIdentifier_ != NULL)72 {73 orxout(verbose, context::pickups) << "Pickupable (&" << this << ") destroyed." << endl;74 this->pickupIdentifier_->destroy();75 }76 69 } 77 70 -
code/branches/presentation2012merge/src/orxonox/interfaces/Pickupable.h
r9293 r9318 53 53 Pickups (@ref orxonox::Pickupable "Pickupables") are objects that (quite unsurprisingly) can be picked up. Additionally they can be used and unused (transition from used to not used), and also dropped. 54 54 55 A class of Pickups can incorporate many different types of pickups (see @ref orxonox::PickupIdentifier "PickupIdentifier"), each type is uniquely defined by a @ref orxonox::PickupIdentifier "PickupIdentifier". Each pickup has such an identifier identiying its type. This means that two pickups of the same type have identifiers which are equal.56 57 55 @author 58 56 Damian 'Mozork' Frick … … 70 68 virtual ~Pickupable(); //!< Default destructor. 71 69 70 //! @brief Returns the representation name which refers to the name of the PickupRepresentation that is used to represent this pickup. 71 virtual const std::string& getRepresentationName() const = 0; 72 72 73 /** 73 74 @brief Get whether the Pickupable is currently in use or not. … … 144 145 virtual void clone(OrxonoxClass*& item) {} 145 146 146 /**147 @brief Get the PickupIdentifier of this Pickupable.148 @return Returns a pointer to the PickupIdentifier of this Pickupable.149 */150 virtual const PickupIdentifier* getPickupIdentifier(void) const151 { return this->pickupIdentifier_; }152 153 147 bool setUsed(bool used); //!< Sets the Pickupable to used or unused, depending on the input. 154 148 bool setPickedUp(bool pickedUp); //!< Helper method to set the Pickupable to either picked up or not picked up. … … 158 152 159 153 protected: 160 /**161 @brief Helper method to initialize the PickupIdentifier.162 */163 void initializeIdentifier(void) {}164 165 154 virtual void preDestroy(void); //!< A method that is called by OrxonoxClass::destroy() before the object is actually destroyed. 166 155 virtual void destroyPickup(void); //!< Destroys a Pickupable. … … 187 176 */ 188 177 virtual bool createSpawner(void) = 0; 189 190 PickupIdentifier* pickupIdentifier_; //!< The PickupIdentifier of this Pickupable.191 178 192 179 private:
Note: See TracChangeset
for help on using the changeset viewer.