Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 15, 2010, 7:33:11 AM (14 years ago)
Author:
dafrick
Message:

Added changedPickedUp method to Pickupable to solve a problem in PickupCollection, which, for the most part, works now.

File:
1 edited

Legend:

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

    r6519 r6521  
    138138    }
    139139   
    140     //TODO: Steal description from Pickupable.
    141140    void PickupCollection::changedUsed(void)
    142141    {
     
    150149    }
    151150   
    152     void PickupCollection::changedCarrier()
     151    void PickupCollection::changedCarrier(void)
    153152    {
    154153        SUPER(PickupCollection, changedCarrier);
    155154       
     155        //! Change used for all Pickupables this PickupCollection consists of.
     156        for(std::vector<Pickupable*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
     157        {
     158            (*it)->setCarrier(this->getCarrier());
     159        }
     160    }
     161   
     162    void PickupCollection::changedPickedUp()
     163    {
     164        SUPER(PickupCollection, changedPickedUp);
     165       
    156166        //! Change the carrier for all Pickupables this PickupCollection consists of.
    157167        for(std::vector<Pickupable*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
    158168        {
    159             (*it)->setCarrier(this->getCarrier());
    160         }
    161     }
    162    
    163     //TODO: Steal description from Pickupable.
     169            (*it)->setPickedUp(this->isPickedUp());
     170        }
     171    }
     172   
    164173    void PickupCollection::clone(OrxonoxClass*& item)
    165174    {
Note: See TracChangeset for help on using the changeset viewer.