Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 5, 2010, 6:26:54 PM (14 years ago)
Author:
dafrick
Message:

Additional documentation, code niceifying and potential bug fixing. Also: Renamed DroppedItem to DroppedPickup.

File:
1 edited

Legend:

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

    r6474 r6475  
    3939#include <list>
    4040#include "core/Super.h"
    41 #include "pickup/PickupIdentifier.h"
    4241
    4342#include "core/OrxonoxClass.h"
     
    8382            bool dropped(void); //!< Sets the Pickupable to not picked up or dropped.
    8483           
    85             bool isTarget(PickupCarrier* carrier); //!< Get whether the given PickupCarrier is a target of this pickup.
     84            bool isTarget(const PickupCarrier* carrier) const; //!< Get whether the given PickupCarrier is a target of this pickup.
    8685            bool addTarget(PickupCarrier* target); //!< Add a PickupCarrier as target of this pickup.
    8786           
     
    108107            */
    109108            virtual const PickupIdentifier* getPickupIdentifier(void)
    110                 { return &this->pickupIdentifier_; }
     109                { return this->pickupIdentifier_; }
    111110               
    112111            virtual void destroy(void)
     
    120119            void initializeIdentifier(void) {}
    121120           
     121            /**
     122            @brief Facilitates the creation of a PickupSpawner upon dropping of the Pickupable.
     123                   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.:
     124                   DroppedPickup(BaseObject* creator, Pickupable* pickup, const Vector3& position, float triggerDistance);
     125            @param position The position at which the PickupSpawner should be placed.
     126            @return Returns true if a spawner was created, false if not.
     127            */
     128            virtual bool createSpawner(const Vector3& position) = 0;
     129           
    122130            //TODO: Move to private and create get method in protected.
    123             PickupIdentifier pickupIdentifier_; //!< The PickupIdentifier of this Pickupable.
     131            PickupIdentifier* pickupIdentifier_; //!< The PickupIdentifier of this Pickupable.
    124132           
    125133        private:
Note: See TracChangeset for help on using the changeset viewer.