Changeset 6538 for code/trunk/src/modules/pickup/PickupCollection.h
- Timestamp:
- Mar 16, 2010, 6:15:45 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/pickup/PickupCollection.h
r6533 r6538 27 27 */ 28 28 29 /** 30 @file PickupCollection.h 31 @brief Declaration of PickupCollection. 32 */ 33 29 34 #ifndef _PickupCollection_H__ 30 35 #define _PickupCollection_H__ … … 34 39 #include "interfaces/Pickupable.h" 35 40 #include "core/BaseObject.h" 36 #include "core/XMLPort.h"37 41 38 42 #include <list> … … 52 56 public: 53 57 54 PickupCollection(BaseObject* creator); 55 virtual ~PickupCollection(); 58 PickupCollection(BaseObject* creator); //!< Default Constructor. 59 virtual ~PickupCollection(); //!< Destructor. 56 60 57 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 61 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Creates an instance of this Class through XML. 58 62 59 virtual void changedUsed(void); 60 virtual void changedCarrier(void); 61 virtual void changedPickedUp(void); 63 virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around. 64 virtual void changedCarrier(void); //!< Is called when the pickup has changed its PickupCarrier. 65 virtual void changedPickedUp(void); //!< Is called when the pickup has transited from picked up to dropped or the other way around. 62 66 63 virtual void clone(OrxonoxClass*& item); 67 virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the input OrxonoxClass. 64 68 65 virtual bool isTarget(Identifier* identifier) const; 69 virtual bool isTarget(Identifier* identifier) const; //!< Get whether a given class, represented by the input Identifier, is a target of this PickupCollection. 66 70 67 virtual const PickupIdentifier* getPickupIdentifier(void); 71 virtual const PickupIdentifier* getPickupIdentifier(void); //!< Get the PickupIdentifier of this PickupCollection. 68 72 69 bool addPickupable(Pickupable* pickup); 70 const Pickupable* getPickupable(unsigned int index); 73 bool addPickupable(Pickupable* pickup); //!< Add the input Pickupable to list of Pickupables combined by this PickupCollection. 74 const Pickupable* getPickupable(unsigned int index); //!< Get the Pickupable at the given index. 71 75 72 76 protected: 73 void initializeIdentifier(void); 77 void initializeIdentifier(void); //!< Initializes the PickupIdentifier for this pickup. 74 78 75 79 virtual bool createSpawner(const Vector3& position); //!< Facilitates the creation of a PickupSpawner upon dropping of the Pickupable. 76 80 77 PickupCollectionIdentifier* pickupCollectionIdentifier_; 81 PickupCollectionIdentifier* pickupCollectionIdentifier_; //!< The PickupCollectionIdentifier of this PickupCollection. Is used to distinguish different PickupCollections amongst themselves. 78 82 79 83 private: 80 84 81 std::vector<WeakPtr<Pickupable> > pickups_; 85 std::vector<WeakPtr<Pickupable> > pickups_; //!< The list of the pointers of all the Pickupables this PickupCollection consists of. They are weak pointers to facilitate testing, whether the pointers are still valid. 82 86 83 87 };
Note: See TracChangeset
for help on using the changeset viewer.