Changeset 7163 for code/trunk/src/modules/pickup/PickupCollection.h
- Timestamp:
- Aug 11, 2010, 8:55:13 AM (14 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/modules/pickup/PickupCollection.h
r6731 r7163 37 37 #include "PickupPrereqs.h" 38 38 39 #include "interfaces/Pickupable.h"40 39 #include "core/BaseObject.h" 40 #include "CollectiblePickup.h" 41 41 42 42 #include <list> … … 47 47 /** 48 48 @brief 49 The PickupCollection combines different Pickupables to a coherent, single pickup and makes the seem (from the outside looking in) just as if they were just one Pickupable.49 The PickupCollection combines different Pickupables to a coherent, single pickup and makes them seem (from the outside looking in) just as if they were just one Pickupable. 50 50 @author 51 51 Damian 'Mozork' Frick 52 52 */ 53 class _PickupExport PickupCollection : public Pickupable, public BaseObject53 class _PickupExport PickupCollection : public CollectiblePickup, public BaseObject 54 54 { 55 55 56 56 public: 57 58 57 PickupCollection(BaseObject* creator); //!< Default Constructor. 59 58 virtual ~PickupCollection(); //!< Destructor. 60 59 61 60 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Creates an instance of this Class through XML. 62 61 … … 64 63 virtual void changedCarrier(void); //!< Is called when the pickup has changed its PickupCarrier. 65 64 virtual void changedPickedUp(void); //!< Is called when the pickup has transited from picked up to dropped or the other way around. 66 65 67 66 virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the input OrxonoxClass. 68 67 69 68 virtual bool isTarget(PickupCarrier* carrier) const; //!< Get whether a given class, represented by the input Identifier, is a target of this PickupCollection. 70 69 71 70 virtual const PickupIdentifier* getPickupIdentifier(void); //!< Get the PickupIdentifier of this PickupCollection. 72 73 bool addPickupable( Pickupable* pickup); //!< Add the input Pickupable to list of Pickupables combined by this PickupCollection.71 72 bool addPickupable(CollectiblePickup* pickup); //!< Add the input Pickupable to list of Pickupables combined by this PickupCollection. 74 73 const Pickupable* getPickupable(unsigned int index); //!< Get the Pickupable at the given index. 75 74 75 void pickupChangedUsed(bool changed); //!< Informs the PickupCollection, that one of its pickups has changed its used status to the input value. 76 void pickupChangedPickedUp(bool changed); //!< Informs the PickupCollection, that one of its pickups has changed its picked up status to the input value. 77 void pickupDisabled(void); //!< Informs the PickupCollection, that one of its pickups has been disabled. 78 76 79 protected: 77 80 void initializeIdentifier(void); //!< Initializes the PickupIdentifier for this pickup. 81 82 virtual bool createSpawner(void); //!< Facilitates the creation of a PickupSpawner upon dropping of the Pickupable. 83 84 PickupCollectionIdentifier* pickupCollectionIdentifier_; //!< The PickupCollectionIdentifier of this PickupCollection. Is used to distinguish different PickupCollections amongst themselves. 85 86 private: 87 void changedUsedAction(void); //!< Helper method. 88 void changedPickedUpAction(void); //!< Helper method. 78 89 79 virtual bool createSpawner(void); //!< Facilitates the creation of a PickupSpawner upon dropping of the Pickupable. 80 81 PickupCollectionIdentifier* pickupCollectionIdentifier_; //!< The PickupCollectionIdentifier of this PickupCollection. Is used to distinguish different PickupCollections amongst themselves. 82 83 private: 84 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. 86 90 std::vector<CollectiblePickup*> 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. 91 92 unsigned int usedCounter_; //!< Keeps track of the number of pickups of this PickupCollection, that are in use. 93 unsigned int pickedUpCounter_; //!< Keeps track of the number of pickups of this PickupCollection, that are picked up. 94 unsigned int disabledCounter_; //!< Keeps track of the number of pickups of this PickupCollection, that are disabled. 95 96 bool processingUsed_; //!< Boolean to ensure, that the PickupCollection doesn't update its used status while its internal state is inconsistent. 97 bool processingPickedUp_; //!< Boolean to ensure, that the PickupCollection doesn't update its picked upp status while its internal state is inconsistent. 98 87 99 }; 88 100 89 101 } 90 102
Note: See TracChangeset
for help on using the changeset viewer.