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 QuestItem class. |
---|
32 | The QuestItem is the parent class of Quest and QuestHint. |
---|
33 | */ |
---|
34 | |
---|
35 | |
---|
36 | #ifndef _QuestItem_H__ |
---|
37 | #define _QuestItem_H__ |
---|
38 | |
---|
39 | #include "objects/quest/QuestPrereqs.h" |
---|
40 | |
---|
41 | #include <string> |
---|
42 | #include "core/BaseObject.h" |
---|
43 | |
---|
44 | namespace orxonox |
---|
45 | { |
---|
46 | /** |
---|
47 | @brief |
---|
48 | Functions as a base class for quest classes such as Quest or QuestHint. |
---|
49 | Has a unique identifier and a description. |
---|
50 | @author |
---|
51 | Damian 'Mozork' Frick |
---|
52 | */ |
---|
53 | class _QuestExport QuestItem : public BaseObject |
---|
54 | { |
---|
55 | |
---|
56 | public: |
---|
57 | QuestItem(BaseObject* creator); |
---|
58 | virtual ~QuestItem(); |
---|
59 | |
---|
60 | virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestItem object through XML. |
---|
61 | |
---|
62 | /** |
---|
63 | @brief Returns the id of this QuestItem. |
---|
64 | @return Returns the id of the QuestItem. |
---|
65 | */ |
---|
66 | inline const std::string & getId(void) const |
---|
67 | { return this->id_; } |
---|
68 | |
---|
69 | /** |
---|
70 | @brief Returns the QuestDescription of the QuestItem. |
---|
71 | @return Returns a pointer to the QuestDescription object of the QuestItem. |
---|
72 | */ |
---|
73 | inline const QuestDescription* getDescription(void) const |
---|
74 | { return this->description_; } |
---|
75 | |
---|
76 | static bool isId(const std::string & id); //!< Checks whether a given id is valid. |
---|
77 | |
---|
78 | protected: |
---|
79 | void setId(const std::string & id); //!< Sets the id of the QuestItem. |
---|
80 | |
---|
81 | /** |
---|
82 | @brief Sets the description of the QuestItem. |
---|
83 | @param description The QuestDescription to be set. |
---|
84 | */ |
---|
85 | inline void setDescription(QuestDescription* description) |
---|
86 | { this->description_ = description; } |
---|
87 | |
---|
88 | private: |
---|
89 | std::string id_; //!< Identifier. Should be of GUID form: http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure |
---|
90 | QuestDescription* description_; //!< The QuestDescription of the QuestItem. |
---|
91 | |
---|
92 | }; |
---|
93 | |
---|
94 | } |
---|
95 | |
---|
96 | #endif /* _QuestItem_H__ */ |
---|