- Timestamp:
- Dec 26, 2009, 10:06:54 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pickup3/src/modules/pickup/PickupCollection.cc
r6420 r6421 58 58 { 59 59 //! Destroy all Pickupables constructing this PickupCollection. 60 for(std:: list<Pickupable*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)60 for(std::vector<Pickupable*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++) 61 61 { 62 62 delete *it; … … 89 89 return false; 90 90 91 this->pickups_. insert(pickup);91 this->pickups_.push_back(pickup); 92 92 return true; 93 93 } … … 101 101 Returns a pointer to the Pickupable at the index given by index. 102 102 */ 103 Pickupable* PickupCollection::getPickupable(unsigned int index)103 const Pickupable* PickupCollection::getPickupable(unsigned int index) 104 104 { 105 105 return this->pickups_[index]; //TODO. Does this work? … … 112 112 113 113 //! Change used for all Pickupables this PickupCollection consists of. 114 for(std:: list<Pickupable*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)114 for(std::vector<Pickupable*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++) 115 115 { 116 116 (*it)->changedUsed(); … … 132 132 bool success = true; 133 133 //! Set all Pickupables to used. 134 for(std:: list<Pickupable*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)134 for(std::vector<Pickupable*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++) 135 135 { 136 136 if(!(*it)->use()) … … 158 158 bool success = true; 159 159 //! Set all Pickupables to unused. 160 for(std:: list<Pickupable*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)160 for(std::vector<Pickupable*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++) 161 161 { 162 162 if(!(*it)->unuse()) … … 187 187 return false; 188 188 } 189 for(std:: list<Pickupable*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)189 for(std::vector<Pickupable*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++) 190 190 { 191 191 (*it)->setOwner(carrier); … … 219 219 220 220 PickupCollection* newCollection = dynamic_cast<PickupCollection*>(newObject); 221 for(std:: list<Pickupable*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)221 for(std::vector<Pickupable*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++) 222 222 { 223 223 Pickupable* newPickup = (*it)->clone();
Note: See TracChangeset
for help on using the changeset viewer.