Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/pickup3/src/modules/pickup/PickupManager.h @ 6486

Last change on this file since 6486 was 6475, checked in by dafrick, 15 years ago

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

File size: 3.1 KB
Line 
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/**
30    @file
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
46namespace orxonox
47{
48    //TODO: Actually utilize this.
49    struct PickupCarrierNode
50    {
51        Identifier* identifier;
52        std::set<PickupCarrierNode*> children;
53    };
54
55    /**
56    @brief
57        Manages Pickupables.
58        In essence has two tasks to fulfill. Firstly it must link Pickupables (through their PickupIdentifiers) and their PickupRepresentations. Secondly it manages the Pickup GUI.
59        //TODO: Manage Pickup GUI.
60    @author
61        Damian 'Mozork' Frick
62    */
63    class _PickupExport PickupManager : public Singleton<PickupManager>, public OrxonoxClass
64    {
65        friend class Singleton<PickupManager>;
66       
67        public:
68            PickupManager();
69            virtual ~PickupManager();
70           
71            static PickupManager& getInstance() { return Singleton<PickupManager>::getInstance(); }
72           
73            bool registerRepresentation(const PickupIdentifier* identifier, PickupRepresentation* representation); //!< Registers a PickupRepresentation together with the PickupIdentifier of the Pickupable the PickupRepresentation represents.
74            PickupRepresentation* getRepresentation(const PickupIdentifier* identifier); //!< Get the PickupRepresentation representing the Pickupable with the input PickupIdentifier.
75           
76            //TODO: Delete or utilitze this.
77            //bool registerCarrier(Identifier* parent, )
78           
79        private:
80            static PickupManager* singletonPtr_s;
81           
82            PickupRepresentation* defaultRepresentation_; //!< The default PickupRepresentation.
83            std::map<const PickupIdentifier*, PickupRepresentation*, PickupIdentifierCompare> representations_; //!< Map linking PickupIdentifiers (representing types if Pickupables) and PickupRepresentations.
84           
85            //TODO: Delete or utilize this.
86            PickupCarrierNode* pickupCarrierStructure_;
87       
88    };
89   
90}
91
92#endif // _PickupManager_H__
Note: See TracBrowser for help on using the repository browser.