Is a Singleton and manages Quests, by registering every Quest / QuestHint (through registerX()) and making them globally accessible (through findX()).
More...
#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/modules/questsystem/QuestManager.h>
Is a Singleton and manages Quests, by registering every Quest / QuestHint (through registerX()) and making them globally accessible (through findX()).
Quests (and QuestHints) are registered in the QuestManager with their id, and can be accessed in the same way.
- Author
- Damian 'Mozork' Frick
orxonox::QuestManager::QuestManager |
( |
| ) |
|
Constructor.
Registers the object.
- Todo:
- Is inheriting from BaseObject proper?
orxonox::QuestManager::~QuestManager |
( |
| ) |
|
|
virtual |
QuestHint * orxonox::QuestManager::findHint |
( |
const std::string & |
hintId | ) |
|
Returns the QuestHint with the input id.
Finds a QuestHint with the given id.
- Parameters
-
- Returns
- Returns a pointer to the QuestHint with the input id. Returns nullptr if there is no QuestHint with the given hintId.
- Exceptions
-
Throws | an exception if the given hintId is invalid. |
Quest * orxonox::QuestManager::findQuest |
( |
const std::string & |
questId | ) |
|
Returns the Quest with the input id.
Finds a Quest with the given id.
- Parameters
-
questId | The id of the Quest sought for. |
- Returns
- Returns a pointer to the Quest with the input id. Returns nullptr if there is no Quest with the given questId.
- Exceptions
-
Throws | an exception if the given questId is invalid. |
Get the index-th QuestHint of the input Quest for the input player.
- Parameters
-
- Returns
- Returns a pointer to the index-th QuestHint of the input Quest for the input player.
const std::string orxonox::QuestManager::getId |
( |
Quest * |
item | ) |
const |
Get the id of the input Quest.
- Parameters
-
item | The Quest to get the id of. |
- Returns
- Returns the id of the input Quest.
const std::string orxonox::QuestManager::getId |
( |
QuestHint * |
item | ) |
const |
Get the id of the input QuestHint.
- Parameters
-
- Returns
- Returns the id of the input QuestHint.
Returns a reference to the single instance of the QuestManager.
Get the number of QuestHints of the input Quest for the input player.
- Parameters
-
quest | The quest to get the hints of. |
player | The player. |
- Returns
- Returns the number of QuestHints of the input Quest for the input player.
Get the number of Quests the input player has, that are root quests.
- Parameters
-
- Returns
- Returns the number of Quests the input player has, that are root quests.
Get the number of sub-quest of an input Quest for an input player.
Get the number of sub-quest of an input Quest for the input player.
- Parameters
-
quest | The quest to get the sub-quests of. |
player | The player. |
- Returns
- Returns the number of sub-quest of an input Quest for the input player.
Quest * orxonox::QuestManager::getParentQuest |
( |
Quest * |
quest | ) |
|
Get the parent-quest of the input Quest.
- Parameters
-
quest | The Quest to get the parent-quest of. |
- Returns
- Returns a pointer to the parent-quest of the input Quest.
std::map< std::string, Quest * > & orxonox::QuestManager::getQuests |
( |
void |
| ) |
|
|
protected |
Retrieve all Quests.
Retreive all Quests.
- Returns
- Returns a map with all Quests indexed by their id's.
Get the index-th root quest of the input player.
- Parameters
-
player | The player. |
index | The index of the root quest. |
- Returns
- Returns the index-th root quest of the input player.
Get the index-th sub-quest of the input Quest for the input player.
- Parameters
-
quest | The Quest to get the sub-quest of. |
player | The player. |
index | The index of the sub-quest. |
bool orxonox::QuestManager::registerHint |
( |
QuestHint * |
hint | ) |
|
Registers a QuestHint in the QuestManager.
Registers a QuestHint with the QuestManager to make it globally accessible.
Uses it's id to make sure to be able to be identify and retrieve it later.
- Parameters
-
- Returns
- Returns true if successful, false if not.
bool orxonox::QuestManager::registerQuest |
( |
Quest * |
quest | ) |
|
Registers a Quest in the QuestManager.
Registers a Quest with the QuestManager to make it globally accessible.
Uses it's id to make sure to be able to be identify and retrieve it later.
- Parameters
-
quest | The Quest that is to be registered. |
- Returns
- Returns true if successful, false if not.
PlayerInfo * orxonox::QuestManager::retrievePlayer |
( |
const std::string & |
guiName | ) |
|
|
private |
Retrieve the player for a certain GUI.
- Parameters
-
guiName | The name of the GUI the player is retrieved for. |
- Returns
- Returns the player.
- Todo:
- This very well might be outdated. So: Check if still needed, and update if necessary.
bool orxonox::QuestManager::unregisterHint |
( |
QuestHint * |
hint | ) |
|
bool orxonox::QuestManager::unregisterQuest |
( |
Quest * |
quest | ) |
|
std::map<std::string, QuestHint*> orxonox::QuestManager::hintMap_ |
|
private |
All QuestHints registered by their id's.
std::map<std::string, Quest*> orxonox::QuestManager::questMap_ |
|
private |
All Quests registered by their id's.
The documentation for this class was generated from the following files: