Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/netp6/src/orxonox/objects/quest/QuestHint.h @ 5838

Last change on this file since 5838 was 3196, checked in by rgrieder, 15 years ago

Merged pch branch back to trunk.

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