Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/questsystem2/src/orxonox/objects/quest/QuestItem.h @ 2159

Last change on this file since 2159 was 2159, checked in by dafrick, 15 years ago

Completed documentation of finished classes.

File size: 2.6 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 */
[2146]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
[2146]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
[2093]53        Functions as a base class for Quest classes such as Quest or QuestHint.
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
[2146]65            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestItem object through XML.
[2092]66
[2093]67            inline const std::string & getId(void) const //!< Returns the id of this quest.
[1992]68                { return this->id_; }
[2093]69            inline const QuestDescription* getDescription(void) const //!< Returns the description of the QuestItem.
[1992]70                { return this->description_; }
[2092]71
[2093]72            static bool isId(const std::string & id); //!< Checks whether a given id is valid.
[2092]73
[2093]74        protected:
[2146]75            void setId(const std::string & id); //!< Sets the id of the QuestItem.
76            inline void setDescription(QuestDescription* description) //!< Sets the description of the QuestItem.
[2068]77                { this->description_ = description; }
[2092]78
[2093]79        private:
80            std::string id_; //!< Identifier. Should be of GUID form: http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure
81            QuestDescription* description_; //!< The description of the QuestItem.
[2092]82
[1992]83    };
84
85}
86
87#endif /* _QuestItem_H__ */
Note: See TracBrowser for help on using the repository browser.