#include <src/orxonox/objects/quest/QuestHint.h>
Public Member Functions | |
Quest * | getQuest (void) |
Returns the Quest the QuestHint is attached to. | |
bool | isActive (const PlayerInfo *player) const |
Returns true if the QuestHint is active for the input player. | |
QuestHint (BaseObject *creator) | |
Constructor. Registers the object. | |
bool | setActive (PlayerInfo *player) |
Activates the QuestHint for the input player. | |
bool | setQuest (Quest *quest) |
Sets the Quest the QuestHint belongs to. | |
virtual void | XMLPort (Element &xmlelement, XMLPort::Mode mode) |
Method for creating a QuestHint object through XML. | |
virtual | ~QuestHint () |
Destructor. | |
Private Attributes | |
std::map< const PlayerInfo *, QuestHintStatus::Value > | playerStatus_ |
List of the states for each player, with the Player-pointer as key. | |
Quest * | quest_ |
The Quest the QuestHint belongs to. |
Creating a QuestHint through XML goes as follows:
<QuestHint id="hintId"> //Where hintId is a GUID, see http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure for more information <QuestDesctription title="" description=""> </QuestHint>
orxonox::QuestHint::QuestHint | ( | BaseObject * | creator | ) |
orxonox::QuestHint::~QuestHint | ( | ) | [virtual] |
Destructor.
Quest* orxonox::QuestHint::getQuest | ( | void | ) | [inline] |
bool orxonox::QuestHint::isActive | ( | const PlayerInfo * | player | ) | const |
Returns true if the QuestHint is active for the input player.
Checks whether the QuestHint is active for a specific player.
player | The player. |
Throws | an Argument Exception if the input Player-pointer is NULL. |
< NULL-Pointers are ugly!
Find the player.
< If the player is in the map.
References orxonox::QuestStatus::Inactive, playerStatus_, and ThrowException.
bool orxonox::QuestHint::setActive | ( | PlayerInfo * | player | ) |
Activates the QuestHint for the input player.
Activates a QuestHint for a given player.
player | The player. |
< For a hint to get activated the quest must be active.
< If the hint is already active, activation is pointless.
References orxonox::QuestHintStatus::Active, COUT, orxonox::QuestItem::getDescription(), orxonox::BaseObject::isActive(), orxonox::Quest::isActive(), playerStatus_, quest_, and orxonox::QuestDescription::sendAddHintNotification().
Referenced by orxonox::AddQuestHint::invoke().
bool orxonox::QuestHint::setQuest | ( | Quest * | quest | ) |
void orxonox::QuestHint::XMLPort | ( | Element & | xmlelement, | |
XMLPort::Mode | mode | |||
) | [virtual] |
Method for creating a QuestHint object through XML.
< Registers the QuestHint with the QuestManager.
Reimplemented from orxonox::QuestItem.
References COUT, orxonox::QuestItem::getId(), orxonox::QuestManager::getInstance(), orxonox::QuestManager::registerHint(), and SUPER.
std::map<const PlayerInfo*, QuestHintStatus::Value> orxonox::QuestHint::playerStatus_ [private] |
List of the states for each player, with the Player-pointer as key.
Referenced by isActive(), and setActive().
Quest* orxonox::QuestHint::quest_ [private] |