Orxonox  0.0.5 Codename: Arcturus
QuestDescription.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 _QuestDescription_H__
36 #define _QuestDescription_H__
37 
39 
40 #include <string>
41 #include "core/BaseObject.h"
42 
43 // tolua_begin
44 namespace orxonox
45 {
46 
63  {
64 // tolua_end
65  public:
66  QuestDescription(Context* context);
67  virtual ~QuestDescription();
68 
69  virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
70 
71 // tolua_begin
76  inline const std::string & getTitle(void) const
77  { return this->title_; }
78 
83  inline const std::string & getDescription(void) const
84  { return this->description_; }
85 // tolua_end
86 
91  inline const std::string & getFailMessage(void)
92  { return this->failMessage_; }
93 
98  inline const std::string & getCompleteMessage(void)
99  { return this->completeMessage_; }
100 
106  inline bool sendAddHintNotification(PlayerInfo* player)
107  { return notificationHelper("hint", "", player); }
108 
115  { return notificationHelper("quest", "start", player); }
116 
123  { return notificationHelper("quest", "fail", player); }
124 
131  { return notificationHelper("quest", "complete", player); }
132 
133  private:
134  static const std::string SENDER;
135 
140 
141  bool notificationHelper(const std::string & item, const std::string & status, PlayerInfo* player);
142 
147  inline void setTitle(const std::string & title)
148  { this->title_ = title; }
149 
154  inline void setDescription(const std::string & description)
155  { this->description_ = description; }
156 
161  inline void setFailMessage(const std::string & message)
162  { this->failMessage_ = message; }
163 
169  { this->completeMessage_ = message; }
170 
171  }; // tolua_export
172 
173 } // tolua_export
174 
175 #endif /* _QuestDescription_H__ */
The BaseObject is the parent of all classes representing an instance in the game. ...
Definition: BaseObject.h:63
bool sendFailQuestNotification(PlayerInfo *player)
Sends a Notification displaying that a Quest was failed.
Definition: QuestDescription.h:122
std::string completeMessage_
The message displayed when the Quest is completed.
Definition: QuestDescription.h:139
::std::string string
Definition: gtest-port.h:756
const std::string & getTitle(void) const
Returns the title.
Definition: QuestDescription.h:76
Output level, used for messages directed to the user (e.g. "Press any key to continue") ...
Definition: OutputDefinitions.h:89
bool sendCompleteQuestNotification(PlayerInfo *player)
Sends a Notification displaying that a Quest was completed.
Definition: QuestDescription.h:130
void setFailMessage(const std::string &message)
Sets the fail message.
Definition: QuestDescription.h:161
std::string title_
The title.
Definition: QuestDescription.h:136
xmlelement
Definition: Super.h:519
void setDescription(const std::string &description)
Sets the description text.
Definition: QuestDescription.h:154
std::string description_
The description.
Definition: QuestDescription.h:137
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
void setCompleteMessage(const std::string &message)
Sets the complete message.
Definition: QuestDescription.h:168
Mode
Definition: CorePrereqs.h:102
const std::string & getFailMessage(void)
Returns the fail message.
Definition: QuestDescription.h:91
const std::string & getDescription(void) const
Returns the description text.
Definition: QuestDescription.h:83
Shared library macros, enums, constants and forward declarations for the questsystem module ...
const std::string & getCompleteMessage(void)
Returns the complete message.
Definition: QuestDescription.h:98
Declaration of BaseObject, the base class of all objects in Orxonox.
Definition: Context.h:45
void setTitle(const std::string &title)
Sets the title.
Definition: QuestDescription.h:147
std::string failMessage_
The message displayed when the Quest is failed.
Definition: QuestDescription.h:138
bool sendAddHintNotification(PlayerInfo *player)
Sends a Notification displaying that a QuestHint was added.
Definition: QuestDescription.h:106
void status(const std::string &text)
Prints output with status level.
Definition: ConsoleCommandCompilation.cc:153
Definition: PlayerInfo.h:39
static const std::string SENDER
Definition: QuestDescription.h:134
bool sendAddQuestNotification(PlayerInfo *player)
Sends a Notification displaying that a Quest was added.
Definition: QuestDescription.h:114
#define _QuestsystemExport
Definition: QuestsystemPrereqs.h:60