#include <src/orxonox/objects/quest/AddQuestHint.h>
Public Member Functions | |
AddQuestHint (BaseObject *creator) | |
Constructor. Registers the object. | |
virtual bool | invoke (PlayerInfo *player) |
Invokes the QuestEffect. | |
virtual void | XMLPort (Element &xmlelement, XMLPort::Mode mode) |
Method for creating a AddQuestHint object through XML. | |
virtual | ~AddQuestHint () |
Destructor. | |
Private Member Functions | |
const std::string & | getHintId (void) const |
Returns the id of the QuestHint. | |
bool | setHintId (const std::string &id) |
Sets the id of the QuestHint. | |
Private Attributes | |
std::string | hintId_ |
The id of the QuestHint. |
Creating a AddQuestHint through XML goes as follows:
<AddQuestHint hintid="id"> //Where id is a GUID, see http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure for more information, and identifies the QuestHint that should be added.
orxonox::AddQuestHint::AddQuestHint | ( | BaseObject * | creator | ) |
orxonox::AddQuestHint::~AddQuestHint | ( | ) | [virtual] |
Destructor.
const std::string& orxonox::AddQuestHint::getHintId | ( | void | ) | const [inline, private] |
bool orxonox::AddQuestHint::invoke | ( | PlayerInfo * | player | ) | [virtual] |
Invokes the QuestEffect.
player | The player. |
< NULL-pointers are evil!
Implements orxonox::QuestEffect.
References COUT, orxonox::QuestManager::findHint(), orxonox::Exception::getFullDescription(), getHintId(), orxonox::QuestManager::getInstance(), hintId_, and orxonox::QuestHint::setActive().
bool orxonox::AddQuestHint::setHintId | ( | const std::string & | id | ) | [private] |
Sets the id of the QuestHint.
Sets the id of the QuestHint to be added to the player the QuestEffect is invoked on.
id | The QuestHint id. | |
Returns | true if successful. |
References COUT, hintId_, and orxonox::QuestItem::isId().
Referenced by XMLPort().
void orxonox::AddQuestHint::XMLPort | ( | Element & | xmlelement, | |
XMLPort::Mode | mode | |||
) | [virtual] |
Method for creating a AddQuestHint object through XML.
Reimplemented from orxonox::BaseObject.
References COUT, getHintId(), setHintId(), SUPER, and XMLPortParam.
std::string orxonox::AddQuestHint::hintId_ [private] |