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
Line 
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
32        Definition of the QuestItem class.
33       
34        The QuestItem is the parent class of Quest and QuestHint.
35*/
36
37
38#ifndef _QuestItem_H__
39#define _QuestItem_H__
40
41#include "OrxonoxPrereqs.h"
42
43#include <string>
44
45#include "core/BaseObject.h"
46#include "core/XMLPort.h"
47
48namespace orxonox {
49
50
51    /**
52    @brief
53        Functions as a base class for Quest classes such as Quest or QuestHint.
54        Has a unique identifier and a description.
55    @author
56        Damian 'Mozork' Frick
57    */
58    class _OrxonoxExport QuestItem : public BaseObject
59    {
60
61        public:
62            QuestItem(BaseObject* creator);
63            virtual ~QuestItem();
64
65            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestItem object through XML.
66
67            inline const std::string & getId(void) const //!< Returns the id of this quest.
68                { return this->id_; }
69            inline const QuestDescription* getDescription(void) const //!< Returns the description of the QuestItem.
70                { return this->description_; }
71
72            static bool isId(const std::string & id); //!< Checks whether a given id is valid.
73
74        protected:
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.
77                { this->description_ = description; }
78
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.
82
83    };
84
85}
86
87#endif /* _QuestItem_H__ */
Note: See TracBrowser for help on using the repository browser.