Changeset 6512 for code/branches/pickup3/src/orxonox
- Timestamp:
- Mar 11, 2010, 4:30:30 PM (15 years ago)
- Location:
- code/branches/pickup3/src/orxonox/interfaces
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pickup3/src/orxonox/interfaces/PickupCarrier.h
r6477 r6512 40 40 #include <set> 41 41 #include "Pickupable.h" 42 #include "core/Identifier.h" 42 43 43 44 #include "core/OrxonoxClass.h" … … 45 46 namespace orxonox 46 47 { 48 49 class Pickup; 50 class HealthPickup; 51 class TestPickup; 47 52 48 53 /** … … 55 60 { 56 61 friend class Pickupable; //!< The Pickupable has full acces to its PickupCarrier. 62 //TODO: Ugly workaround. 63 friend class Pickup; 64 friend class HealthPickup; 65 friend class TestPickup; 57 66 58 67 public: … … 69 78 bool pickedUp = this->pickups_.insert(pickup).second; 70 79 if(pickedUp) 80 { 81 COUT(4) << "Picked up Pickupable " << pickup->getIdentifier()->getName() << "(&" << pickup << ")." << std::endl; 71 82 pickup->pickedUp(this); 83 } 72 84 return pickedUp; 73 85 } … … 81 93 bool drop(Pickupable* pickup, bool drop = true) 82 94 { 83 bool dropped = this->pickups_.erase(pickup) == 1; 84 if(dropped && drop) 85 { 86 pickup->dropped(); 87 } 88 return dropped; 95 bool dropped = this->pickups_.erase(pickup) == 1; 96 if(dropped && drop) 97 { 98 COUT(4) << "Dropping Pickupable " << pickup->getIdentifier()->getName() << "(&" << pickup << ")." << std::endl; 99 pickup->dropped(); 100 } 101 return dropped; 89 102 } 90 103 … … 161 174 */ 162 175 virtual const Vector3& getCarrierPosition(void) = 0; 176 177 //TODO: Remove. 178 std::set<Pickupable*>& getPickups(void) 179 { return this->pickups_; } 163 180 164 181 private: -
code/branches/pickup3/src/orxonox/interfaces/Pickupable.cc
r6497 r6512 198 198 //TODO: possible problem. 199 199 if(!created) 200 { 200 201 this->destroy(); 202 } 201 203 202 204 return true;
Note: See TracChangeset
for help on using the changeset viewer.