Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/modules/questsystem/QuestGUI.h @ 5746

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

Forgot to add files…

File size: 3.5 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 QuestGIU class.
32*/
33
34#ifndef _QuestGUI_H__
35#define _QuestGUI_H__
36
37#include "questsystem/QuestsystemPrereqs.h"
38#include <CEGUIForwardRefs.h>
39
40#include "core/OrxonoxClass.h"
41
42#include <map>
43#include <string>
44#include <list>
45
46namespace orxonox {
47
48    /**
49    @brief
50        Handles the GUI for the Questsystem.
51    @author
52        Damian 'Mozork' Frick
53    */
54    class _QuestsystemExport QuestGUI : public OrxonoxClass
55    {
56
57        public:
58       
59            QuestGUI(PlayerInfo* player);
60            virtual ~QuestGUI();
61
62            CEGUI::Window* getGUI(void); //!< Get the root CEGUI Window of the GUI.
63            void update(void); //!< Update the GUI.
64
65            /**
66            @brief Retreive the CEGUI WindowManager.
67            @return Returns the CEGUI WindoWManager.
68            */
69            inline CEGUI::WindowManager* getWindowManager(void)
70                { return this->windowManager_; }
71            /**
72            @brief Retrieve the root window.
73            @return Returns the root window.
74            */
75            inline CEGUI::Window* getRootWindow(void)
76                { return this->rootWindow_; }
77
78            CEGUI::Window* getWindow(void); //!< Get a CEGUI Window to use.
79            void giveWindow(CEGUI::Window* window); //!< Return a no longer needed CEGUI Window for reuse.
80
81            /**
82            @brief Retreive the player.
83            @return Returns the player.
84            */
85            inline PlayerInfo* getPlayer(void)
86                { return this->player_; }
87
88            static QuestGUINode* findNode(CEGUI::Window* window); //!< Finde the QuestGUINode belonging to the input CEGUI Window.
89   
90        private:
91           
92            int createNode(QuestGUINode* parent, QuestItem* item, int depth, int index); //!< Recursive method to create Nodes for all Quests an Hints the given Quest is a parent to.
93
94            void clear(void); //!< Clear the QuestGUI.
95           
96            PlayerInfo* player_; //!< The player that owns the GUI.
97            CEGUI::WindowManager* windowManager_; //!< The CEGUI WindowManager. //TDO: needed?
98            CEGUI::Window* rootWindow_; //!< The root CEGUI Window of the GUI.
99
100            QuestGUINode* root_; //!< An empty QuestGUINode being the parent of all otherwise parent-less nodes.
101            std::map<CEGUI::Window*, QuestGUINode*> nodes_; //!< A list of all QuestGUINodes, ordered by their respective CEGUI Windows.
102            std::list<CEGUI::Window*> windows_; //!< A list of windows to be used.
103
104    };
105
106}
107
108#endif /* _QuestGUI_H__ */
109
Note: See TracBrowser for help on using the repository browser.