Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/modules/questsystem/QuestItem.h @ 7456

Last change on this file since 7456 was 7456, checked in by dafrick, 14 years ago

Reviewing documentation fo Questsystem, moving documentation fully into doxygen.
Added some files to modules they belong to.

  • Property svn:eol-style set to native
File size: 3.5 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 Definition of the QuestItem class.
32        The @ref orxonox::QuestItem "QuestItem" is the parent class of @ref orxonox::Quest "Quest" and @ref orxonox::QuestHint "QuestHint".
33    @ingroup Questsystem
34*/
35
36
37#ifndef _QuestItem_H__
38#define _QuestItem_H__
39
40#include "questsystem/QuestsystemPrereqs.h"
41
42#include <string>
43#include "core/BaseObject.h"
44#include "QuestManager.h"
45
46namespace orxonox
47{
48    /**
49    @brief
50        Functions as a base class for quest classes such as @ref orxonox::Quest "Quest" or @ref orxonox::QuestHint "QuestHint".
51        Has a unique identifier and a @ref orxonox::QuestDescription "QuestDescription".
52    @author
53        Damian 'Mozork' Frick
54    */
55    class _QuestsystemExport QuestItem : public BaseObject
56    {
57
58        public:
59            QuestItem(BaseObject* creator);
60            virtual ~QuestItem();
61
62            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestItem object through XML.
63
64            /**
65            @brief Returns the id of this QuestItem.
66            @return Returns the id of the QuestItem.
67            */
68            inline const std::string & getId(void) const
69                { return this->id_; }
70
71            /**
72            @brief Returns the QuestDescription of the QuestItem.
73            @return Returns a pointer to the QuestDescription object of the QuestItem.
74            */
75            inline QuestDescription* getDescription(void) const
76                { return this->description_; }
77
78            /**
79            @brief Check whether the QuestItem is registered with the QuestManager.
80            @return Returns true if the QuestItem is registered with the QuestManager.
81            */
82            inline bool isRegistered(void)
83                { return this->registered_; }
84            /**
85            @brief Set the QuestItem as being registered with the QuestManager.
86            */
87            inline void setRegistered(void)
88                { this->registered_ = true; }
89
90        protected:
91            void setId(const std::string & id); //!< Sets the id of the QuestItem.
92
93            /**
94            @brief Sets the description of the QuestItem.
95            @param description The QuestDescription to be set.
96            */
97            inline void setDescription(QuestDescription* description)
98                { this->description_ = description; }
99
100        private:
101            std::string id_; //!< Identifier. Must be unique.
102            QuestDescription* description_; //!< The QuestDescription of the QuestItem.
103
104            bool registered_;
105
106    };
107
108}
109
110#endif /* _QuestItem_H__ */
Note: See TracBrowser for help on using the repository browser.