Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 18, 2012, 10:36:24 PM (12 years ago)
Author:
landauf
Message:

removed PickupIdentifier for a number of reasons (I talked to Damian about it before)
a pickup now references the PickupRepresentation by name with the "representation" attribute

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2012merge/src/modules/pickup/PickupCollection.cc

    r9296 r9318  
    3939#include "CollectiblePickup.h"
    4040#include "DroppedPickup.h"
    41 #include "PickupCollectionIdentifier.h"
    4241
    4342#include "PickupCollection.h"
     
    5453        The creator of the object.
    5554    */
    56     PickupCollection::PickupCollection(BaseObject* creator) : BaseObject(creator), pickupCollectionIdentifier_(NULL)
     55    PickupCollection::PickupCollection(BaseObject* creator) : BaseObject(creator)
    5756    {
    5857        RegisterObject(PickupCollection);
    5958
    60         this->pickupCollectionIdentifier_ = new PickupCollectionIdentifier(this);
    6159        this->processingUsed_ = false;
    6260        this->processingPickedUp_ = false;
     
    7674        }
    7775        this->pickups_.clear();
    78 
    79         if(this->pickupCollectionIdentifier_ != NULL)
    80             this->pickupCollectionIdentifier_->destroy();
    8176    }
    8277
     
    8984        SUPER(PickupCollection, XMLPort, xmlelement, mode);
    9085
     86        XMLPortParam(PickupCollection, "representation", setRepresentationName, getRepresentationName, xmlelement, mode);
    9187        XMLPortObject(PickupCollection, CollectiblePickup, "pickupables", addPickupable, getPickupable, xmlelement, mode);
    9288    }
     
    217213
    218214        PickupCollection* pickup = orxonox_cast<PickupCollection*>(item);
     215        pickup->setRepresentationName(this->getRepresentationName());
    219216        // Clone all Pickupables this PickupCollection consist of.
    220217        for(std::list<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); ++it)
     
    243240
    244241        return true;
    245     }
    246 
    247     /**
    248     @brief
    249         Get the PickupIdentifier of this PickupCollection.
    250         This is in fact the PickupCollectionIdentifier.
    251     @return
    252         Returns a pointer to the PickupIdentifier of this PickupCollection.
    253     */
    254     const PickupIdentifier* PickupCollection::getPickupIdentifier(void) const
    255     {
    256         return this->pickupCollectionIdentifier_;
    257242    }
    258243
Note: See TracChangeset for help on using the changeset viewer.