Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 26, 2009, 10:06:54 AM (14 years ago)
Author:
dafrick
Message:

Some Documenting and bug fixes.

File:
1 edited

Legend:

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

    r6420 r6421  
    5858    {
    5959        //! 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++)
    6161        {
    6262            delete *it;
     
    8989            return false;
    9090       
    91         this->pickups_.insert(pickup);
     91        this->pickups_.push_back(pickup);
    9292        return true;
    9393    }
     
    101101        Returns a pointer to the Pickupable at the index given by index.
    102102    */
    103     Pickupable* PickupCollection::getPickupable(unsigned int index)
     103    const Pickupable* PickupCollection::getPickupable(unsigned int index)
    104104    {
    105105        return this->pickups_[index]; //TODO. Does this work?
     
    112112       
    113113        //! 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++)
    115115        {
    116116            (*it)->changedUsed();
     
    132132        bool success = true;
    133133        //! 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++)
    135135        {
    136136            if(!(*it)->use())
     
    158158        bool success = true;
    159159        //! 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++)
    161161        {
    162162            if(!(*it)->unuse())
     
    187187            return false;
    188188        }
    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++)
    190190        {
    191191            (*it)->setOwner(carrier);
     
    219219       
    220220        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++)
    222222        {
    223223            Pickupable* newPickup = (*it)->clone();
Note: See TracChangeset for help on using the changeset viewer.