[6474] | 1 | /* |
---|
| 2 | * ORXONOX - the hottest 3D action shooter ever to exist |
---|
| 3 | * > www.orxonox.net < |
---|
| 4 | * |
---|
| 5 | * |
---|
| 6 | * License notice: |
---|
| 7 | * |
---|
| 8 | * This program is free software; you can redistribute it and/or |
---|
| 9 | * modify it under the terms of the GNU General Public License |
---|
| 10 | * as published by the Free Software Foundation; either version 2 |
---|
| 11 | * of the License, or (at your option) any later version. |
---|
| 12 | * |
---|
| 13 | * This program is distributed in the hope that it will be useful, |
---|
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 16 | * GNU General Public License for more details. |
---|
| 17 | * |
---|
| 18 | * You should have received a copy of the GNU General Public License |
---|
| 19 | * along with this program; if not, write to the Free Software |
---|
| 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
| 21 | * |
---|
| 22 | * Author: |
---|
| 23 | * Damian 'Mozork' Frick |
---|
| 24 | * Co-authors: |
---|
| 25 | * ... |
---|
| 26 | * |
---|
| 27 | */ |
---|
| 28 | |
---|
| 29 | /** |
---|
[6540] | 30 | @file PickupManager.h |
---|
[6474] | 31 | @brief Definition of the PickupManager class. |
---|
| 32 | */ |
---|
| 33 | |
---|
| 34 | #ifndef _PickupManager_H__ |
---|
| 35 | #define _PickupManager_H__ |
---|
| 36 | |
---|
| 37 | #include "PickupPrereqs.h" |
---|
| 38 | |
---|
| 39 | #include <map> |
---|
| 40 | #include "util/Singleton.h" |
---|
| 41 | #include "pickup/PickupIdentifier.h" |
---|
| 42 | #include "PickupRepresentation.h" |
---|
| 43 | |
---|
| 44 | #include "core/OrxonoxClass.h" |
---|
| 45 | |
---|
[6711] | 46 | namespace orxonox // tolua_export |
---|
| 47 | { // tolua_export |
---|
[6474] | 48 | |
---|
| 49 | /** |
---|
| 50 | @brief |
---|
| 51 | Manages Pickupables. |
---|
[6711] | 52 | In essence has two tasks to fulfill. Firstly it must link Pickupables (through their PickupIdentifiers) and their PickupRepresentations. Secondly it manages the PickupInventory. |
---|
[6474] | 53 | //TODO: Manage Pickup GUI. |
---|
| 54 | @author |
---|
| 55 | Damian 'Mozork' Frick |
---|
| 56 | */ |
---|
[6711] | 57 | class _PickupExport PickupManager // tolua_export |
---|
| 58 | : public Singleton<PickupManager>, public OrxonoxClass |
---|
| 59 | { // tolua_export |
---|
[6474] | 60 | friend class Singleton<PickupManager>; |
---|
| 61 | |
---|
| 62 | public: |
---|
| 63 | PickupManager(); |
---|
| 64 | virtual ~PickupManager(); |
---|
| 65 | |
---|
[6711] | 66 | static PickupManager& getInstance() { return Singleton<PickupManager>::getInstance(); } // tolua_export |
---|
[6474] | 67 | |
---|
[6475] | 68 | bool registerRepresentation(const PickupIdentifier* identifier, PickupRepresentation* representation); //!< Registers a PickupRepresentation together with the PickupIdentifier of the Pickupable the PickupRepresentation represents. |
---|
[6474] | 69 | PickupRepresentation* getRepresentation(const PickupIdentifier* identifier); //!< Get the PickupRepresentation representing the Pickupable with the input PickupIdentifier. |
---|
| 70 | |
---|
[6711] | 71 | // tolua_begin |
---|
| 72 | orxonox::PickupCarrier* getPawn(void); |
---|
| 73 | |
---|
| 74 | int getNumCarrierChildren(orxonox::PickupCarrier* carrier); |
---|
| 75 | orxonox::PickupCarrier* getCarrierChild(int index, orxonox::PickupCarrier* carrier); |
---|
| 76 | |
---|
| 77 | const std::string& getCarrierName(orxonox::PickupCarrier* carrier); |
---|
| 78 | |
---|
| 79 | int getNumPickups(orxonox::PickupCarrier* carrier); |
---|
| 80 | PickupRepresentation* getPickupRepresentation(int index, orxonox::PickupCarrier* carrier); |
---|
| 81 | void dropPickup(int index, orxonox::PickupCarrier* carrier); |
---|
| 82 | void usePickup(int index, orxonox::PickupCarrier* carrier, bool use); |
---|
| 83 | // tolua_end |
---|
| 84 | |
---|
[6474] | 85 | private: |
---|
| 86 | static PickupManager* singletonPtr_s; |
---|
[6711] | 87 | static const std::string guiName_s; |
---|
[6474] | 88 | |
---|
| 89 | PickupRepresentation* defaultRepresentation_; //!< The default PickupRepresentation. |
---|
[6475] | 90 | std::map<const PickupIdentifier*, PickupRepresentation*, PickupIdentifierCompare> representations_; //!< Map linking PickupIdentifiers (representing types if Pickupables) and PickupRepresentations. |
---|
[6474] | 91 | |
---|
[6711] | 92 | }; // tolua_export |
---|
[6474] | 93 | |
---|
[6711] | 94 | } // tolua_export |
---|
[6474] | 95 | |
---|
| 96 | #endif // _PickupManager_H__ |
---|