Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 18, 2012, 10:36:24 PM (12 years ago)
Author:
landauf
Message:

removed PickupIdentifier for a number of reasons (I talked to Damian about it before)
a pickup now references the PickupRepresentation by name with the "representation" attribute

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

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2012merge/src/orxonox/interfaces/Pickupable.cc

    r9293 r9318  
    3939
    4040#include "infos/PlayerInfo.h"
    41 #include "pickup/PickupIdentifier.h"
    4241#include "worldentities/pawns/Pawn.h"
    4342
     
    5251        Constructor. Registers the objects and initializes its member variables.
    5352    */
    54     Pickupable::Pickupable() : pickupIdentifier_(NULL), used_(false), pickedUp_(false)
     53    Pickupable::Pickupable() : used_(false), pickedUp_(false)
    5554    {
    5655        RegisterRootObject(Pickupable);
     
    5857        this->carrier_ = NULL;
    5958
    60         this->pickupIdentifier_ = new PickupIdentifier(this);
    6159        this->beingDestroyed_ = false;
    6260        this->enabled_ = true;
     
    6967    Pickupable::~Pickupable()
    7068    {
    71         if(this->pickupIdentifier_ != NULL)
    72         {
    73             orxout(verbose, context::pickups) << "Pickupable (&" << this << ") destroyed." << endl;
    74             this->pickupIdentifier_->destroy();
    75         }
    7669    }
    7770
  • code/branches/presentation2012merge/src/orxonox/interfaces/Pickupable.h

    r9293 r9318  
    5353        Pickups (@ref orxonox::Pickupable "Pickupables") are objects that (quite unsurprisingly) can be picked up. Additionally they can be used and unused (transition from used to not used), and also dropped.
    5454
    55         A class of Pickups can incorporate many different types of pickups (see @ref orxonox::PickupIdentifier "PickupIdentifier"), each type is uniquely defined by a @ref orxonox::PickupIdentifier "PickupIdentifier". Each pickup has such an identifier identiying its type. This means that two pickups of the same type have identifiers which are equal.
    56 
    5755    @author
    5856        Damian 'Mozork' Frick
     
    7068            virtual ~Pickupable(); //!< Default destructor.
    7169
     70            //! @brief Returns the representation name which refers to the name of the PickupRepresentation that is used to represent this pickup.
     71            virtual const std::string& getRepresentationName() const = 0;
     72
    7273            /**
    7374            @brief Get whether the Pickupable is currently in use or not.
     
    144145            virtual void clone(OrxonoxClass*& item) {}
    145146
    146             /**
    147             @brief Get the PickupIdentifier of this Pickupable.
    148             @return Returns a pointer to the PickupIdentifier of this Pickupable.
    149             */
    150             virtual const PickupIdentifier* getPickupIdentifier(void) const
    151                 { return this->pickupIdentifier_; }
    152 
    153147            bool setUsed(bool used); //!< Sets the Pickupable to used or unused, depending on the input.
    154148            bool setPickedUp(bool pickedUp); //!< Helper method to set the Pickupable to either picked up or not picked up.
     
    158152
    159153        protected:
    160             /**
    161             @brief Helper method to initialize the PickupIdentifier.
    162             */
    163             void initializeIdentifier(void) {}
    164 
    165154            virtual void preDestroy(void); //!< A method that is called by OrxonoxClass::destroy() before the object is actually destroyed.
    166155            virtual void destroyPickup(void); //!< Destroys a Pickupable.
     
    187176            */
    188177            virtual bool createSpawner(void) = 0;
    189 
    190             PickupIdentifier* pickupIdentifier_; //!< The PickupIdentifier of this Pickupable.
    191178
    192179        private:
Note: See TracChangeset for help on using the changeset viewer.