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