Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/questsystem3/src/orxonox/objects/quest/QuestItem.h @ 2281

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

merged questsystem2 back to trunk

File size: 3.0 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            /**
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
72                { return this->id_; }
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
78                { return this->description_; }
79
80            static bool isId(const std::string & id); //!< Checks whether a given id is valid.
81
82        protected:
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            */
89            inline void setDescription(QuestDescription* description)
90                { this->description_ = description; }
91
92        private:
93            std::string id_; //!< Identifier. Should be of GUID form: http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure
94            QuestDescription* description_; //!< The QuestDescription of the QuestItem.
95
96    };
97
98}
99
100#endif /* _QuestItem_H__ */
Note: See TracBrowser for help on using the repository browser.