Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/orxonox/objects/quest/QuestItem.h @ 2331

Last change on this file since 2331 was 2261, checked in by landauf, 16 years ago

merged questsystem2 back to trunk

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