Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 11128 was 11071, checked in by landauf, 9 years ago

merged branch cpp11_v3 back to trunk

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