Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/libraries/src/orxonox/objects/quest/QuestHint.h @ 5721

Last change on this file since 5721 was 5648, checked in by landauf, 15 years ago

sorry, large commit, but all changes are dependent:

  • Created a new plugin for the questsystem (called just "quest" for the moment because I'd had to rename the directory otherwise (the tolua script enforces this))
  • Added QuestPrereqs.h file and _QuestExport macro
  • Moved the GUI-name ↔ PlayerInfo map from QuestManager to GUIManager
  • Moved NotificationOverlay and NotificationQueue from overlays to quest and linked the overlays plugin into the quest plugin
  • Made QuestManager and NotificationManager ScopedSingletons with ScopeID GSLevel. Also removed both singletons from GSLevel and added the Scope instance instead.
  • Property svn:eol-style set to native
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 */
[5648]28
[2261]29/**
[3196]30    @file
[2662]31    @brief Definition of the QuestHint class.
[2261]32*/
[2092]33
[1992]34#ifndef _QuestHint_H__
35#define _QuestHint_H__
36
[5648]37#include "objects/quest/QuestPrereqs.h"
[2095]38
[1996]39#include <map>
[1992]40#include "QuestItem.h"
41
[2662]42namespace orxonox
[2021]43{
[3280]44    namespace QuestHintStatus
[2021]45    {
[2662]46        //! The state of the hint.
[3280]47        enum Value
[2662]48        {
[3280]49            Inactive,
50            Active
[2662]51        };
52    }
[1992]53
54    /**
55    @brief
56        Represents a hint in the game towards completing a Quest.
[2261]57        Consists of title and description (which is stored in a QuestDescription object) in textual form and must belong to a quest.
58        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.
[5648]59
[2261]60        Creating a QuestHint through XML goes as follows:
[5648]61
[2261]62        <QuestHint id="hintId">  //Where hintId is a GUID, see http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure for more information
63            <QuestDesctription title="" description="" />
64        </QuestHint>
[1992]65    @author
66        Damian 'Mozork' Frick
67    */
[5648]68    class _QuestExport QuestHint : public QuestItem
[1992]69    {
[2092]70
[2093]71        public:
[2092]72            QuestHint(BaseObject* creator);
[2093]73            virtual ~QuestHint();
[2092]74
[2261]75            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestHint object through XML.
[2092]76
[2261]77            bool isActive(const PlayerInfo* player) const; //!< Returns true if the QuestHint is active for the input player.
[2092]78
[2261]79            bool setActive(PlayerInfo* player); //!< Activates the QuestHint for the input player.
80            bool setQuest(Quest* quest); //!< Sets the Quest the QuestHint belongs to.
[2092]81
[2261]82            /**
83            @brief Returns the Quest the QuestHint is attached to.
84            @return  Returns a pointer to the Quest the QuestHint is attached to.
85            */
[2093]86            inline Quest* getQuest(void)
87               { return this->quest_; }
[2092]88
[2021]89        private:
[2261]90            Quest* quest_; //!< The Quest the QuestHint belongs to.
[3280]91            std::map<const PlayerInfo*, QuestHintStatus::Value> playerStatus_; //!< List of the states for each player, with the Player-pointer as key.
[2092]92
[1992]93    };
94
95}
96
97#endif /* _QuestHint_H__ */
Note: See TracBrowser for help on using the repository browser.