Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 13, 2010, 3:32:34 PM (14 years ago)
Author:
dafrick
Message:

Started documenting MetaPcikup, resolved some bugs in PickupCollection and PickupCollectionIdentifier.

File:
1 edited

Legend:

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

    r6497 r6519  
    4545{
    4646 
     47    CreateFactory(PickupCollection);
     48
    4749    /**
    4850    @brief
     
    7779        SUPER(PickupCollection, XMLPort, xmlelement, mode);
    7880       
    79         //TODO: Does this work? Problem could be, that Pickupable itself cannot be instantiated through XML, doubt that, though.
    80         XMLPortObject(PickupCollection, PickupCollection, "pickupables", addPickupable, getPickupable, xmlelement, mode);
     81        XMLPortObject(PickupCollection, Pickupable, "pickupables", addPickupable, getPickupable, xmlelement, mode);
    8182       
    8283        this->initializeIdentifier();
     
    103104    bool PickupCollection::createSpawner(const Vector3& position)
    104105    {
    105         DroppedPickup::DroppedPickup(this, this, position);
     106        new DroppedPickup(this, this, position);
    106107        return true;
    107108    }
     
    178179    }
    179180   
     181    bool PickupCollection::isTarget(Identifier* identifier) const
     182    {
     183        for(std::vector<Pickupable*>::const_iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
     184        {
     185            if(!(*it)->isTarget(identifier))
     186                return false;
     187        }
     188       
     189        return true;
     190    }
     191   
    180192    const PickupIdentifier* PickupCollection::getPickupIdentifier(void)
    181193    {
Note: See TracChangeset for help on using the changeset viewer.