Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 30, 2012, 11:08:17 PM (12 years ago)
Author:
landauf
Message:

merged branch presentation2012merge back to trunk

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/interfaces/Pickupable.h

    r8866 r9348  
    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
     
    6967        public:
    7068            virtual ~Pickupable(); //!< Default destructor.
     69
     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;
    7172
    7273            /**
     
    136137            bool addTarget(Identifier* identifier); //!< Add a class, representetd by the input Identifier, as target of this Pickupable.
    137138
    138             Pickupable* clone(void); //!< Creates a duplicate of the Pickupable.
    139             /**
    140             @brief Creates a duplicate of the input OrxonoxClass.
    141                    This method needs to be implemented by any Class inheriting from Pickupable.
    142             @param item A reference to a pointer to the OrxonoxClass that is to be duplicated.
    143             */
    144             virtual void clone(OrxonoxClass*& item) {}
    145 
    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 
    153139            bool setUsed(bool used); //!< Sets the Pickupable to used or unused, depending on the input.
    154140            bool setPickedUp(bool pickedUp); //!< Helper method to set the Pickupable to either picked up or not picked up.
     
    158144
    159145        protected:
    160             /**
    161             @brief Helper method to initialize the PickupIdentifier.
    162             */
    163             void initializeIdentifier(void) {}
    164 
    165146            virtual void preDestroy(void); //!< A method that is called by OrxonoxClass::destroy() before the object is actually destroyed.
    166147            virtual void destroyPickup(void); //!< Destroys a Pickupable.
     
    174155
    175156            /**
     157            @brief Check whether the Pickupable is in the process of being destroyed.
     158            @return Returns true if so.
     159            */
     160            inline bool isBeingDestroyed(void)
     161                { return this->beingDestroyed_; }
     162
     163            /**
    176164            @brief Facilitates the creation of a PickupSpawner upon dropping of the Pickupable.
    177                    This method must be implemented by any class directly inheriting from Pickupable. It is most easily done by just creating a new DroppedPickup, e.g.:
    178                    DroppedPickup(BaseObject* creator, Pickupable* pickup, PickupCarrier* carrier, float triggerDistance);
     165                   This method must be implemented by any class directly inheriting from Pickupable.
    179166            @return Returns true if a spawner was created, false if not.
    180167            */
    181168            virtual bool createSpawner(void) = 0;
    182 
    183             PickupIdentifier* pickupIdentifier_; //!< The PickupIdentifier of this Pickupable.
    184169
    185170        private:
     
    203188    //! SUPER functions.
    204189    SUPER_FUNCTION(10, Pickupable, changedUsed, false);
    205     SUPER_FUNCTION(12, Pickupable, changedCarrier, false);
    206     SUPER_FUNCTION(13, Pickupable, changedPickedUp, false);
    207     SUPER_FUNCTION(11, Pickupable, clone, false);
     190    SUPER_FUNCTION(11, Pickupable, changedCarrier, false);
     191    SUPER_FUNCTION(12, Pickupable, changedPickedUp, false);
    208192}
    209193
Note: See TracChangeset for help on using the changeset viewer.