Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/presentation/src/orxonox/objects/quest/QuestItem.h @ 2385

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

Merged questsystem3.

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