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:

orxonox::BaseObject orxonox::OrxonoxClass orxonox::Quest orxonox::QuestHint orxonox::GlobalQuest orxonox::LocalQuest

List of all members.

Public Member Functions

const QuestDescriptiongetDescription (void) const
 Returns the QuestDescription of the QuestItem.
const std::stringgetId (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

QuestDescriptiondescription_
 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]

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

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


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

Generated on Tue Jul 28 16:22:59 2009 for Orxonox by  doxygen 1.5.6