| 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 QuestHint.h | 
|---|
| 31 | @brief Definition of the QuestHint class. | 
|---|
| 32 | @ingroup Questsystem | 
|---|
| 33 | */ | 
|---|
| 34 |  | 
|---|
| 35 | #ifndef _QuestHint_H__ | 
|---|
| 36 | #define _QuestHint_H__ | 
|---|
| 37 |  | 
|---|
| 38 | #include "questsystem/QuestsystemPrereqs.h" | 
|---|
| 39 |  | 
|---|
| 40 | #include <map> | 
|---|
| 41 | #include "QuestItem.h" | 
|---|
| 42 |  | 
|---|
| 43 | namespace orxonox // tolua_export | 
|---|
| 44 | { // tolua_export | 
|---|
| 45 |  | 
|---|
| 46 | /** | 
|---|
| 47 | @brief | 
|---|
| 48 | The state of the @ref orxonox::QuestHint "QuestHint". | 
|---|
| 49 |  | 
|---|
| 50 | @ingroup Questsystem | 
|---|
| 51 | */ | 
|---|
| 52 | enum class QuestHintStatus | 
|---|
| 53 | { | 
|---|
| 54 | Inactive, //!< The @ref orxonox::QuestHint "QuestHint" is inactive. | 
|---|
| 55 | Active //!< The @ref orxonox::QuestHint "QuestHint" is active. | 
|---|
| 56 | }; | 
|---|
| 57 |  | 
|---|
| 58 | /** | 
|---|
| 59 | @brief | 
|---|
| 60 | Represents a hint in the game that gives aid towards completing a @ref orxonox::Quest "Quest". | 
|---|
| 61 | Consists of title and description (which is stored in a @ref orxonox::QuestDescription "QuestDescription" object) in textual form and must belong to a quest. | 
|---|
| 62 | 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. | 
|---|
| 63 |  | 
|---|
| 64 | Creating a QuestHint through XML goes as follows: | 
|---|
| 65 | @code | 
|---|
| 66 | <QuestHint id="hintId"> | 
|---|
| 67 | <QuestDesctription title="" description="" /> | 
|---|
| 68 | </QuestHint> | 
|---|
| 69 | @endcode | 
|---|
| 70 |  | 
|---|
| 71 | @author | 
|---|
| 72 | Damian 'Mozork' Frick | 
|---|
| 73 |  | 
|---|
| 74 | @ingroup Questsystem | 
|---|
| 75 | */ | 
|---|
| 76 | class _QuestsystemExport QuestHint // tolua_export | 
|---|
| 77 | : public QuestItem | 
|---|
| 78 | { // tolua_export | 
|---|
| 79 |  | 
|---|
| 80 | public: | 
|---|
| 81 | QuestHint(Context* context); | 
|---|
| 82 | virtual ~QuestHint(); | 
|---|
| 83 |  | 
|---|
| 84 | virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; //!< Method for creating a QuestHint object through XML. | 
|---|
| 85 |  | 
|---|
| 86 | bool isActive(const PlayerInfo* player) const; //!< Returns true if the QuestHint is active for the input player. | 
|---|
| 87 |  | 
|---|
| 88 | bool setActive(PlayerInfo* player); //!< Activates the QuestHint for the input player. | 
|---|
| 89 | bool setQuest(Quest* quest); //!< Sets the Quest the QuestHint belongs to. | 
|---|
| 90 |  | 
|---|
| 91 | /** | 
|---|
| 92 | @brief Returns the Quest the QuestHint is attached to. | 
|---|
| 93 | @return  Returns a pointer to the Quest the QuestHint is attached to. | 
|---|
| 94 | */ | 
|---|
| 95 | inline Quest* getQuest(void) | 
|---|
| 96 | { return this->quest_; } | 
|---|
| 97 |  | 
|---|
| 98 | private: | 
|---|
| 99 | Quest* quest_; //!< The Quest the QuestHint belongs to. | 
|---|
| 100 | std::map<const PlayerInfo*, QuestHintStatus> playerStatus_; //!< List of the states for each player, with the Player-pointer as key. | 
|---|
| 101 |  | 
|---|
| 102 | }; // tolua_export | 
|---|
| 103 |  | 
|---|
| 104 | } // tolua_export | 
|---|
| 105 |  | 
|---|
| 106 | #endif /* _QuestHint_H__ */ | 
|---|