Orxonox  0.0.5 Codename: Arcturus
QuestManager.h
Go to the documentation of this file.
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 
35 #ifndef _QuestManager_H__
36 #define _QuestManager_H__
37 
39 
40 #include <list>
41 #include <map>
42 #include <string>
43 
44 #include "util/Singleton.h"
45 
46 namespace orxonox // tolua_export
47 { // tolua_export
48 
59  class _QuestsystemExport QuestManager // tolua_export
60  : public Singleton<QuestManager>
61  { // tolua_export
62 
63  friend class Singleton<QuestManager>;
64 
65  public:
66  QuestManager();
67  virtual ~QuestManager();
68 
70  static QuestManager& getInstance() { return Singleton<QuestManager>::getInstance(); } // tolua_export
71 
72  // tolua_begin
73  int getNumRootQuests(orxonox::PlayerInfo* player);
74  Quest* getRootQuest(orxonox::PlayerInfo* player, int index);
75 
76  int getNumSubQuests(Quest* quest, orxonox::PlayerInfo* player);
77  Quest* getSubQuest(Quest* quest, orxonox::PlayerInfo* player, int index);
78 
79  int getNumHints(Quest* quest, orxonox::PlayerInfo* player);
80  QuestHint* getHints(Quest* quest, orxonox::PlayerInfo* player, int index);
81 
82  Quest* getParentQuest(Quest* quest);
83 
84  QuestDescription* getDescription(Quest* item);
85  QuestDescription* getDescription(QuestHint* item);
86 
87  const std::string getId(Quest* item) const;
88  const std::string getId(QuestHint* item) const;
89  // tolua_end
90 
91  bool registerQuest(Quest* quest);
92  bool unregisterQuest(Quest* quest);
93  bool registerHint(QuestHint* hint);
94  bool unregisterHint(QuestHint* hint);
95 
96  Quest* findQuest(const std::string & questId);
97  QuestHint* findHint(const std::string & hintId);
98 
99  protected:
100  std::map<std::string, Quest*> & getQuests(void);
101 
102  private:
104  PlayerInfo* retrievePlayer(const std::string & guiName);
105 
106  std::map<std::string, Quest*> questMap_;
107  std::map<std::string, QuestHint*> hintMap_;
108 
109  }; // tolua_export
110 
111 } // tolua_export
112 
113 #endif /* _QuestManager_H__ */
std::map< std::string, Quest * > questMap_
All Quests registered by their id&#39;s.
Definition: QuestManager.h:106
static QuestManager * singletonPtr_s
Definition: QuestManager.h:103
::std::string string
Definition: gtest-port.h:756
Represents a Quest in the game.
Definition: Quest.h:77
std::map< std::string, QuestHint * > hintMap_
All QuestHints registered by their id&#39;s.
Definition: QuestManager.h:107
Base for singleton classes.
Definition: Singleton.h:114
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
This class is a description of a QuestItem (Quest and QuestHint).
Definition: QuestDescription.h:62
Shared library macros, enums, constants and forward declarations for the questsystem module ...
static QuestManager & getInstance()
Returns a reference to the single instance of the QuestManager.
Definition: QuestManager.h:70
Definition of the Singleton template that is used as base class for classes that allow only one insta...
Is a Singleton and manages Quests, by registering every Quest / QuestHint (through registerX()) and m...
Definition: QuestManager.h:59
Definition: PlayerInfo.h:39
static T & getInstance()
Returns a reference to the singleton instance.
Definition: Singleton.h:118
Represents a hint in the game that gives aid towards completing a Quest.
Definition: QuestHint.h:76
#define _QuestsystemExport
Definition: QuestsystemPrereqs.h:60