Orxonox
0.0.5 Codename: Arcturus
|
The LevelManager keeps track of Levels whose activity has been requested and activates the Levels in the list in a FIFO manner with exactly one Level (the first in the list) being active at all times (unless the list is empty). More...
#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/orxonox/LevelManager.h>
Public Member Functions | |
LevelManager () | |
virtual | ~LevelManager () |
Level * | getActiveLevel () |
Get the currently active Level. More... | |
LevelInfoItem * | getAvailableLevelListItem (unsigned int index) |
Get the LevelInfoItem at the given index in the list of available Levels. More... | |
const std::string & | getCampaignMission (unsigned int index) |
const std::string & | getDefaultLevel () const |
Get the default level. More... | |
const std::string & | getLastFinishedCampaignMission () const |
unsigned int | getNumberOfCampaignMissions () |
unsigned int | getNumberOfLevels (void) |
void | releaseActivity (Level *level) |
Release activity for the input Level. More... | |
void | requestActivity (Level *level) |
Request activity for the input Level. More... | |
void | setConfigValues () |
Set the config values for this object. More... | |
void | setDefaultLevel (const std::string &levelName) |
Set the default Level. More... | |
void | setLastFinishedCampaignMission (const std::string &lastFinishedCampaignMission) |
Public Member Functions inherited from orxonox::Configurable | |
Configurable () | |
void | setConfigValues () |
Function to collect the SetConfigValue-macro calls. More... | |
Public Member Functions inherited from orxonox::Listable | |
Listable () | |
Constructor: Allocates space in the element list. More... | |
Listable (Context *context) | |
Constructor: Allocates space in the element list and assigns the context. More... | |
virtual | ~Listable () |
Destructor: Removes the object from the object-lists. More... | |
Context * | getContext () const |
void | setContext (Context *context) |
Changes the context. More... | |
void | unregisterObject () |
Removes this object from the object-lists. More... | |
Public Member Functions inherited from orxonox::Identifiable | |
Identifiable () | |
Constructor: Sets the default values. More... | |
virtual | ~Identifiable () |
ORX_FORCEINLINE void * | getDerivedPointer (unsigned int classID) |
Returns a valid pointer of any derived type that is registered in the class hierarchy. More... | |
template<class T > | |
ORX_FORCEINLINE T * | getDerivedPointer (unsigned int classID) |
Version of getDerivedPointer with template. More... | |
template<class T > | |
ORX_FORCEINLINE const T * | getDerivedPointer (unsigned int classID) const |
Const version of getDerivedPointer with template. More... | |
Identifier * | getIdentifier () const |
Returns the Identifier of the object. More... | |
bool | isA (const Identifier *identifier) |
Returns true if the object's class is of the given type or a derivative. More... | |
template<class B > | |
bool | isA (const SubclassIdentifier< B > *identifier) |
Returns true if the object's class is of the given type or a derivative. More... | |
bool | isA (const Identifiable *object) |
Returns true if the object's class is of the given type or a derivative. More... | |
bool | isChildOf (const Identifier *identifier) |
Returns true if the object's class is a child of the given type. More... | |
template<class B > | |
bool | isChildOf (const SubclassIdentifier< B > *identifier) |
Returns true if the object's class is a child of the given type. More... | |
bool | isChildOf (const Identifiable *object) |
Returns true if the object's class is a child of the given type. More... | |
bool | isDirectChildOf (const Identifier *identifier) |
Returns true if the object's class is a direct child of the given type. More... | |
template<class B > | |
bool | isDirectChildOf (const SubclassIdentifier< B > *identifier) |
Returns true if the object's class is a direct child of the given type. More... | |
bool | isDirectChildOf (const Identifiable *object) |
Returns true if the object's class is a direct child of the given type. More... | |
bool | isDirectParentOf (const Identifier *identifier) |
Returns true if the object's class is a direct parent of the given type. More... | |
template<class B > | |
bool | isDirectParentOf (const SubclassIdentifier< B > *identifier) |
Returns true if the object's class is a direct parent of the given type. More... | |
bool | isDirectParentOf (const Identifiable *object) |
Returns true if the object's class is a direct child of the given type. More... | |
bool | isExactlyA (const Identifier *identifier) |
Returns true if the object's class is exactly of the given type. More... | |
template<class B > | |
bool | isExactlyA (const SubclassIdentifier< B > *identifier) |
Returns true if the object's class is exactly of the given type. More... | |
bool | isExactlyA (const Identifiable *object) |
Returns true if the object's class is exactly of the given type. More... | |
bool | isParentOf (const Identifier *identifier) |
Returns true if the object's class is a parent of the given type. More... | |
template<class B > | |
bool | isParentOf (const SubclassIdentifier< B > *identifier) |
Returns true if the object's class is a parent of the given type. More... | |
bool | isParentOf (const Identifiable *object) |
Returns true if the object's class is a parent of the given type. More... | |
Static Public Member Functions | |
static LevelManager & | getInstance () |
Get the instance of the LevelManager. More... | |
Static Public Member Functions inherited from orxonox::Singleton< LevelManager > | |
static bool | exists () |
Tells whether the singleton has been created. More... | |
static LevelManager & | getInstance () |
Returns a reference to the singleton instance. More... | |
Private Member Functions | |
LevelManager (const LevelManager &)=delete | |
void | activateNextLevel () |
Activate the next level. More... | |
void | compileAvailableLevelList (void) |
Compile the list of available Levels. More... | |
LevelManager & | operator= (const LevelManager &)=delete |
void | updateAvailableLevelList (void) |
Update the list of available Levels. More... | |
Private Attributes | |
std::set< LevelInfoItem *, LevelInfoCompare > | availableLevels_ |
The set of available Levels sorted alphabetically according to the name of the Level. More... | |
std::vector< std::string > | campaignMissions_ |
std::string | defaultLevelName_ |
The next expected Level to be accessed. More... | |
std::string | lastFinishedCampaignMission_ |
std::list< Level * > | levels_ |
A list of all the Levels whose activity has been requested, in the order in which they will become active. More... | |
unsigned int | nextIndex_ |
std::set< LevelInfoItem *, LevelInfoCompare >::iterator | nextLevel_ |
The next expected index to be accessed. More... | |
Static Private Attributes | |
static LevelManager * | singletonPtr_s |
Friends | |
class | Singleton< LevelManager > |
Additional Inherited Members | |
Protected Member Functions inherited from orxonox::Singleton< LevelManager > | |
Singleton () | |
Constructor sets the singleton instance pointer. More... | |
virtual | ~Singleton () |
Destructor resets the singleton instance pointer. More... | |
The LevelManager keeps track of Levels whose activity has been requested and activates the Levels in the list in a FIFO manner with exactly one Level (the first in the list) being active at all times (unless the list is empty).
It also serves as an access point to get a list of all available Levels (or rather their respective LevelInfoItems).
orxonox::LevelManager::LevelManager | ( | ) |
|
virtual |
|
privatedelete |
|
private |
Activate the next level.
Compile the list of available Levels.
LevelInfoItem* orxonox::LevelManager::getAvailableLevelListItem | ( | unsigned int | index | ) |
Get the LevelInfoItem at the given index in the list of available Levels.
|
inline |
|
inline |
Get the default level.
|
inlinestatic |
Get the instance of the LevelManager.
|
inline |
|
inline |
unsigned int orxonox::LevelManager::getNumberOfLevels | ( | void | ) |
|
privatedelete |
void orxonox::LevelManager::setConfigValues | ( | ) |
Set the config values for this object.
void orxonox::LevelManager::setLastFinishedCampaignMission | ( | const std::string & | lastFinishedCampaignMission | ) |
Update the list of available Levels.
|
friend |
|
private |
The set of available Levels sorted alphabetically according to the name of the Level.
|
private |
|
private |
The next expected Level to be accessed.
|
private |
|
private |
A list of all the Levels whose activity has been requested, in the order in which they will become active.
|
private |
|
private |
The next expected index to be accessed.
|
staticprivate |