Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/questsystem2/src/orxonox/objects/quest/QuestHint.h @ 2261

Last change on this file since 2261 was 2251, checked in by dafrick, 16 years ago

Some cleanup…

File size: 3.2 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 */
[2146]28 
29/**
30    @file QuestHint.h
31    @brief
[2251]32    Definition of the QuestHint class.
[2146]33*/
[2092]34
[1992]35#ifndef _QuestHint_H__
36#define _QuestHint_H__
37
[2095]38#include "OrxonoxPrereqs.h"
39
[1996]40#include <map>
[1992]41#include <string>
42
[2068]43#include "core/XMLPort.h"
[1992]44#include "QuestItem.h"
45
[2021]46namespace questHintStatus
47{
48
[2146]49    //! The status of the hint.
[2021]50    enum Enum
51    {
52        inactive,
53        active
54    };
55
56}
57
[1992]58namespace orxonox
59{
60
61    /**
62    @brief
63        Represents a hint in the game towards completing a Quest.
[2191]64        Consists of title and description (which is stored in a QuestDescription object) in textual form and must belong to a quest.
65        A QuestHint has a defined status (inactive or active, where inactive is default) for each player, which means each a QuestHint exists only once for all players, it doesn't belong to a player, it just has different states for each of them.
[2146]66       
67        Creating a QuestHint through XML goes as follows:
68       
69        <QuestHint id="hintId">  //Where hintId is a GUID, see http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure for more information
70            <QuestDesctription title="" description="" />
71        </QuestHint>
[1992]72    @author
73        Damian 'Mozork' Frick
74    */
[2095]75    class _OrxonoxExport QuestHint : public QuestItem
[1992]76    {
[2092]77
[2093]78        public:
[2092]79            QuestHint(BaseObject* creator);
[2093]80            virtual ~QuestHint();
[2092]81
[2146]82            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestHint object through XML.
[2092]83
[2205]84            bool isActive(const PlayerInfo* player) const; //!< Returns true if the QuestHint is active for the input player.
[2092]85
[2205]86            bool setActive(PlayerInfo* player); //!< Activates the QuestHint for the input player.
[2191]87            bool setQuest(Quest* quest); //!< Sets the Quest the QuestHint belongs to.
[2092]88
[2191]89            /**
90            @brief Returns the Quest the QuestHint is attached to.
91            @return  Returns a pointer to the Quest the QuestHint is attached to.
92            */
93            inline Quest* getQuest(void)
[2093]94               { return this->quest_; }
[2092]95
[2021]96        private:
[2191]97            Quest* quest_; //!< The Quest the QuestHint belongs to.
[2205]98            std::map<const PlayerInfo*, questHintStatus::Enum> playerStatus_; //!< List of the status for each player, with the Player-pointer as key.
[2092]99
[1992]100    };
101
102}
103
104#endif /* _QuestHint_H__ */
Note: See TracBrowser for help on using the repository browser.