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