Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 11, 2010, 4:30:30 PM (15 years ago)
Author:
dafrick
Message:

Added additional pickup (TestPickup), and did some bug $fixing.

Location:
code/branches/pickup3/src/orxonox/interfaces
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pickup3/src/orxonox/interfaces/PickupCarrier.h

    r6477 r6512  
    4040#include <set>
    4141#include "Pickupable.h"
     42#include "core/Identifier.h"
    4243
    4344#include "core/OrxonoxClass.h"
     
    4546namespace orxonox
    4647{
     48   
     49    class Pickup;
     50    class HealthPickup;
     51    class TestPickup;
    4752
    4853    /**
     
    5560    {
    5661        friend class Pickupable; //!< The Pickupable has full acces to its PickupCarrier.
     62        //TODO: Ugly workaround.
     63        friend class Pickup;
     64        friend class HealthPickup;
     65        friend class TestPickup;
    5766       
    5867        public:
     
    6978                    bool pickedUp = this->pickups_.insert(pickup).second;
    7079                    if(pickedUp)
     80                    {
     81                        COUT(4) << "Picked up Pickupable " << pickup->getIdentifier()->getName() << "(&" << pickup << ")." << std::endl;
    7182                        pickup->pickedUp(this);
     83                    }
    7284                    return pickedUp;
    7385                }
     
    8193            bool drop(Pickupable* pickup, bool drop = true)
    8294                {
    83                    bool dropped = this->pickups_.erase(pickup) == 1;
    84                    if(dropped && drop)
    85                    {
    86                        pickup->dropped();
    87                    }
    88                    return dropped;
     95                    bool dropped = this->pickups_.erase(pickup) == 1;
     96                    if(dropped && drop)
     97                    {
     98                        COUT(4) << "Dropping Pickupable " << pickup->getIdentifier()->getName() << "(&" << pickup << ")." << std::endl;
     99                        pickup->dropped();
     100                    }
     101                    return dropped;
    89102                }
    90103               
     
    161174            */
    162175            virtual const Vector3& getCarrierPosition(void) = 0;
     176                           
     177            //TODO: Remove.
     178            std::set<Pickupable*>& getPickups(void)
     179                { return this->pickups_; }
    163180       
    164181        private:
  • code/branches/pickup3/src/orxonox/interfaces/Pickupable.cc

    r6497 r6512  
    198198        //TODO: possible problem.
    199199        if(!created)
     200        {
    200201            this->destroy();
     202        }
    201203       
    202204        return true;
Note: See TracChangeset for help on using the changeset viewer.