- Timestamp:
- Mar 5, 2010, 6:26:54 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pickup3/src/modules/pickup/PickupCollection.cc
r6466 r6475 38 38 #include "core/XMLPort.h" 39 39 #include "interfaces/PickupCarrier.h" 40 #include "DroppedPickup.h" 41 42 #include "PickupCollectionIdentifier.h" 40 43 41 44 namespace orxonox … … 49 52 { 50 53 RegisterObject(PickupCollection); 54 55 this->pickupCollectionIdentifier_ = new PickupCollectionIdentifier(); 51 56 } 52 57 … … 60 65 for(std::vector<Pickupable*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++) 61 66 { 62 delete *it;67 (*it)->destroy(); 63 68 } 64 69 } … … 80 85 void PickupCollection::initializeIdentifier(void) 81 86 { 82 this->pickupCollectionIdentifier_ .addClass(this->getIdentifier());87 this->pickupCollectionIdentifier_->addClass(this->getIdentifier()); 83 88 84 89 for(std::vector<Pickupable*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++) 85 90 { 86 this->pickupCollectionIdentifier_ .addPickup((*it)->getPickupIdentifier());91 this->pickupCollectionIdentifier_->addPickup((*it)->getPickupIdentifier()); 87 92 } 93 } 94 95 /** 96 @brief 97 Facilitates the creation of a PickupSpawner upon dropping of the Pickupable. 98 This method must be implemented by any class directly inheriting from Pickupable. It is most easily done by just creating a new DroppedPickup, e.g.: 99 DroppedPickup(BaseObject* creator, Pickupable* pickup, const Vector3& position); 100 @param position 101 The position at which the PickupSpawner should be placed. 102 @return 103 Returns true if a spawner was created, false if not. 104 */ 105 bool PickupCollection::createSpawner(const Vector3& position) 106 { 107 DroppedPickup::DroppedPickup(this, this, position); 108 return true; 88 109 } 89 110 … … 159 180 } 160 181 182 const PickupIdentifier* PickupCollection::getPickupIdentifier(void) 183 { 184 return this->pickupCollectionIdentifier_; 185 } 186 161 187 }
Note: See TracChangeset
for help on using the changeset viewer.