Orxonox  0.0.5 Codename: Arcturus
QuestListener.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 _QuestListener_H__
36 #define _QuestListener_H__
37 
39 
40 #include <string>
41 #include <list>
42 #include "core/BaseObject.h"
43 
44 namespace orxonox
45 {
52  enum class QuestListenerMode
53  {
54  All,
55  Start,
56  Fail,
57  Complete
58  };
59 
83  {
84 
85  public:
86  QuestListener(Context* context);
87  virtual ~QuestListener();
88 
89  virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
90 
91  static void advertiseStatusChange(std::list<QuestListener*> & listeners, const std::string & status);
92 
93  bool setQuestId(const std::string & id);
94  bool setMode(const std::string & mode);
95 
96  std::string getMode(void);
97 
98  const std::string & getQuestId(void);
99  bool execute(void);
100 
101  private:
104 
106  static const std::string ALL;
107  static const std::string START;
108  static const std::string FAIL;
109  static const std::string COMPLETE;
110 
111  };
112 
113 }
114 
115 #endif /* _QuestListener_H__ */
The BaseObject is the parent of all classes representing an instance in the game. ...
Definition: BaseObject.h:63
QuestListenerMode
The mode of the QuestListener.
Definition: QuestListener.h:52
::std::string string
Definition: gtest-port.h:756
static const std::string START
Definition: QuestListener.h:107
Represents a Quest in the game.
Definition: Quest.h:77
Quest * quest_
A pointer to the Quest the QuestListener is reacting to.
Definition: QuestListener.h:103
static const std::string ALL
Static variables for the modes as strings.
Definition: QuestListener.h:106
Only listens to events pertaining the failing of Quests.
xmlelement
Definition: Super.h:519
QuestListenerMode mode_
The mode of the QuestListener.
Definition: QuestListener.h:102
Only listens to events pertaining the completing of Quests.
Only listens to events pertaining the starting of Quests.
Provides a way to react to the starting, completing and failing of Quests.
Definition: QuestListener.h:82
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
Mode
Definition: CorePrereqs.h:102
Shared library macros, enums, constants and forward declarations for the questsystem module ...
Declaration of BaseObject, the base class of all objects in Orxonox.
Definition: Context.h:45
static const std::string COMPLETE
Definition: QuestListener.h:109
static const std::string FAIL
Definition: QuestListener.h:108
void status(const std::string &text)
Prints output with status level.
Definition: ConsoleCommandCompilation.cc:153
#define _QuestsystemExport
Definition: QuestsystemPrereqs.h:60