Changeset 7206 for code/trunk/src/modules/pickup/PickupManager.h
- Timestamp:
- Aug 23, 2010, 11:43:10 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/pickup/PickupManager.h
r7163 r7206 52 52 Manages Pickupables. 53 53 In essence has two tasks to fulfill. Firstly it must link Pickupables (through their PickupIdentifiers) and their PickupRepresentations. Secondly it manages the PickupInventory. 54 //TODO: Manage Pickup GUI.55 54 @author 56 55 Damian 'Mozork' Frick … … 72 71 73 72 // tolua_begin 74 int getNumPickups(void); 73 orxonox::PickupRepresentation* getPickupRepresentation(orxonox::Pickupable* pickup); //!< Get the PickupRepresentation of an input Pickupable. 74 75 int getNumPickups(void); //!< Update the list of picked up Pickupables and get the number of Pickupables in the list. 76 /** 77 @brief Get the next Pickupable in the list. 78 Use this, after having called getNumPickups() to access all the Pickupables individually and in succession. 79 @return Returns the next Pickupable in the list. 80 */ 75 81 orxonox::Pickupable* popPickup(void) { return (this->pickupsIterator_++)->first; } 76 orxonox::PickupRepresentation* getPickupRepresentation(orxonox::Pickupable* pickup) { if(pickup != NULL) return this->getRepresentation(pickup->getPickupIdentifier()); return NULL; }77 82 78 void dropPickup(orxonox::Pickupable* pickup); 79 void usePickup(orxonox::Pickupable* pickup, bool use); 80 bool isValidPickup(orxonox::Pickupable* pickup) { std::map<Pickupable*, WeakPtr<Pickupable> >::iterator it = this->pickupsList_.find(pickup); if(it == this->pickupsList_.end()) return false; return it->second.get() != NULL; }83 void dropPickup(orxonox::Pickupable* pickup); //!< Drop the input Pickupable. 84 void usePickup(orxonox::Pickupable* pickup, bool use); //!< Use (or unuse) the input Pickupable. 85 bool isValidPickup(orxonox::Pickupable* pickup); //!< Check whether the input Pickupable is valid, meaning that it is in the PickupManager's list and still exists. 81 86 // tolua_end 82 87 83 88 private: 84 89 static PickupManager* singletonPtr_s; 85 static const std::string guiName_s; 90 static const std::string guiName_s; //!< The name of the PickupInventory 86 91 87 92 PickupRepresentation* defaultRepresentation_; //!< The default PickupRepresentation. 88 93 std::map<const PickupIdentifier*, PickupRepresentation*, PickupIdentifierCompare> representations_; //!< Map linking PickupIdentifiers (representing types if Pickupables) and PickupRepresentations. 89 94 90 std::map<Pickupable*, WeakPtr<Pickupable> > pickupsList_; 91 std::map<Pickupable*, WeakPtr<Pickupable> >::iterator pickupsIterator_; 95 std::map<Pickupable*, WeakPtr<Pickupable> > pickupsList_; //!< A list of all the picked up Pickupables. 96 std::map<Pickupable*, WeakPtr<Pickupable> >::iterator pickupsIterator_; //!< An iterator pointing to the current Pickupable in pickupsList_. 92 97 93 std::vector<PickupCarrier*>* getAllCarriers(PickupCarrier* carrier );98 std::vector<PickupCarrier*>* getAllCarriers(PickupCarrier* carrier, std::vector<PickupCarrier*>* carriers = NULL); //!< Helper method. Get all the PickupCarriers that carry Pickupables, recursively. 94 99 95 100 }; // tolua_export
Note: See TracChangeset
for help on using the changeset viewer.