- Timestamp:
- Jul 21, 2012, 3:51:06 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2012merge/src/modules/pickup/PickupCollection.cc
r9319 r9320 196 196 if(!isOnePickupEnabledAndPickedUp && this->isPickedUp()) 197 197 this->Pickupable::destroy(); 198 }199 200 /**201 @brief202 Creates a duplicate of the input Pickupable.203 This method needs to be implemented by any Class inheriting from Pickupable.204 @param item205 A reference to a pointer to the OrxonoxClass that is to be duplicated.206 */207 void PickupCollection::clone(OrxonoxClass*& item)208 {209 if(item == NULL)210 item = new PickupCollection(this);211 212 SUPER(PickupCollection, clone, item);213 214 PickupCollection* pickup = orxonox_cast<PickupCollection*>(item);215 pickup->setRepresentationName(this->getRepresentationName());216 // Clone all Pickupables this PickupCollection consist of.217 for(std::list<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); ++it)218 {219 Pickupable* newPickup = (*it)->clone();220 CollectiblePickup* collectible = static_cast<CollectiblePickup*>(newPickup);221 pickup->addPickupable(collectible);222 }223 198 } 224 199
Note: See TracChangeset
for help on using the changeset viewer.