Orxonox: orxonox::QuestItem Class Reference

# orxonox::QuestItem Class Reference

Functions as a base class for quest classes such as Quest or QuestHint. Has a unique identifier and a description. More...

`#include <src/orxonox/objects/quest/QuestItem.h>`

Inheritance diagram for orxonox::QuestItem:

List of all members.

## Public Member Functions

const QuestDescription * | getDescription (void) const
| Returns the QuestDescription of the QuestItem.
const std::string & | getId (void) const
| Returns the id of this QuestItem.
| QuestItem (BaseObject *creator)
| Constructor. Registers and initializes the object.
virtual void | XMLPort (Element &xmlelement, XMLPort::Mode mode)
| Method for creating a QuestItem object through XML.
virtual | ~QuestItem ()
| Destructor.

## Static Public Member Functions

static bool | isId (const std::string &id)
| Checks whether a given id is valid.

## Protected Member Functions

void | setDescription (QuestDescription *description)
| Sets the description of the QuestItem.
void | setId (const std::string &id)
| Sets the id of the QuestItem.

## Private Attributes

QuestDescription * | description_
| The QuestDescription of the QuestItem.
std::string | id_
| Identifier. Should be of GUID form: http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure.

## Detailed Description

Functions as a base class for quest classes such as Quest or QuestHint. Has a unique identifier and a description.

Author:
  Damian 'Mozork' Frick

## Constructor & Destructor Documentation

orxonox::QuestItem::QuestItem | ( | BaseObject * | creator | ) |

Constructor. Registers and initializes the object.

References id_, and RegisterObject.

orxonox::QuestItem::~QuestItem | ( |  | ) | `[virtual]`

Destructor.

## Member Function Documentation

const QuestDescription* orxonox::QuestItem::getDescription | ( | void |  | ) | const`[inline]`

Returns the QuestDescription of the QuestItem.

Returns:
  Returns a pointer to the QuestDescription object of the QuestItem.

Referenced by orxonox::QuestManager::addSubQuest(), orxonox::Quest::complete(), orxonox::Quest::fail(), orxonox::QuestHint::setActive(), orxonox::Quest::start(), and XMLPort().

const std::string& orxonox::QuestItem::getId | ( | void |  | ) | const`[inline]`

Returns the id of this QuestItem.

Returns:
  Returns the id of the QuestItem.

Referenced by orxonox::Quest::addCompleteEffect(), orxonox::Quest::addFailEffect(), orxonox::Quest::addHint(), orxonox::GlobalQuest::addRewardEffect(), orxonox::Quest::addSubQuest(), orxonox::Quest::complete(), orxonox::Quest::fail(), orxonox::QuestListener::getQuestId(), orxonox::FailQuest::invoke(), orxonox::CompleteQuest::invoke(), orxonox::QuestManager::registerHint(), orxonox::QuestManager::registerQuest(), orxonox::Quest::setParentQuest(), orxonox::Quest::start(), orxonox::QuestListener::XMLPort(), XMLPort(), orxonox::QuestHint::XMLPort(), orxonox::LocalQuest::XMLPort(), and orxonox::GlobalQuest::XMLPort().

bool orxonox::QuestItem::isId | ( | const std::string & | id | ) | `[static]`

Checks whether a given id is valid.

Checks whether an input id is of the required form.

Parameters:

  | id | The id to be checked.

Returns:
  Returns true if the string is likely to be of the required form.

Referenced by orxonox::QuestManager::findHint(), orxonox::QuestManager::findQuest(), orxonox::AddQuestHint::setHintId(), setId(), and orxonox::ChangeQuestStatus::setQuestId().

void orxonox::QuestItem::setDescription | ( | QuestDescription * | description | ) | `[inline, protected]`

Sets the description of the QuestItem.

Parameters:

  | description | The QuestDescription to be set.

Referenced by XMLPort().

void orxonox::QuestItem::setId | ( | const std::string & | id | ) | `[protected]`

Sets the id of the QuestItem.

Sets the id of the QuestItem. The id must be of GUID form. See 'http://en.wikipedia.org/wiki/Globally_Unique_IdentifierBasic_structure' for more information.

Parameters:

  | id | The id to be set.

< Checks whether the id is a valid id.

References COUT, id_, and isId().

Referenced by XMLPort().

void orxonox::QuestItem::XMLPort | ( | Element & | xmlelement,
|  | XMLPort::Mode | mode |
| ) |  |  | `[virtual]`

Method for creating a QuestItem object through XML.

Reimplemented from orxonox::BaseObject.

Reimplemented in orxonox::GlobalQuest, orxonox::LocalQuest, orxonox::Quest, and orxonox::QuestHint.

References getDescription(), getId(), setDescription(), setId(), SUPER, XMLPortObject, and XMLPortParam.

## Member Data Documentation

QuestDescription* orxonox::QuestItem::description_`[private]`

The QuestDescription of the QuestItem.

std::string orxonox::QuestItem::id_`[private]`

Identifier. Should be of GUID form: http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure.

Referenced by QuestItem(), and setId().

The documentation for this class was generated from the following files:

- src/orxonox/objects/quest/QuestItem.h
- src/orxonox/objects/quest/QuestItem.cc