Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 8, 2010, 8:53:52 PM (14 years ago)
Author:
dafrick
Message:

Significant structural changes to the pickup module. Lots of bugs found and fixed.
Introduced a new class CollectiblePickup (which is now the only kind a PickupCollection can consist of) to solve some issues cleanly.
MetaPickup received additional functionality. It can now also be set to either destroy all the pickups of a PickupCarrier or destroy the PickupCarrier itself. (This was done mainly for testing purposes)
I've done some extensive testing on the pickups, so they should really work now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation3/src/orxonox/interfaces/InterfaceCompilation.cc

    r7127 r7162  
    5959    {
    6060        RegisterRootObject(PickupCarrier);
    61 
    62         this->setCarrierName("PickupCarrier");
    6361    }
    6462
    6563    PickupCarrier::~PickupCarrier()
    6664    {
     65
     66    }
     67
     68    void PickupCarrier::preDestroy(void)
     69    {
    6770        std::set<Pickupable*>::iterator it = this->pickups_.begin();
     71        std::set<Pickupable*>::iterator temp;
    6872        while(it != this->pickups_.end())
    6973        {
    70             (*it)->destroy();
     74            (*it)->carrierDestroyed();
     75            temp = it;
    7176            it = this->pickups_.begin();
     77            if(it == temp) // Infinite loop avoidance, in case the pickup wasn't removed from the carrier somewhere in the carrierDestroy() procedure.
     78            {
     79                COUT(2) << "Oops. In a PickupCarrier, while cleaning up, a Pickupable (&" << (*temp) << ") didn't unregister itself as it should have." << std::endl;;
     80                it++;
     81            }
    7282        }
    7383
Note: See TracChangeset for help on using the changeset viewer.