Orxonox  0.0.5 Codename: Arcturus
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
orxonox::LevelManager Class Reference

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>

Inheritance diagram for orxonox::LevelManager:
orxonox::Singleton< LevelManager > orxonox::Configurable orxonox::Listable orxonox::Identifiable

Public Member Functions

 LevelManager ()
 
virtual ~LevelManager ()
 
LevelgetActiveLevel ()
 Get the currently active Level. More...
 
LevelInfoItemgetAvailableLevelListItem (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...
 
ContextgetContext () 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 voidgetDerivedPointer (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...
 
IdentifiergetIdentifier () 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 LevelManagergetInstance ()
 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 LevelManagergetInstance ()
 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...
 
LevelManageroperator= (const LevelManager &)=delete
 
void updateAvailableLevelList (void)
 Update the list of available Levels. More...
 

Private Attributes

std::set< LevelInfoItem *, LevelInfoCompareavailableLevels_
 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 LevelManagersingletonPtr_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...
 

Detailed Description

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).

Author
Fabian 'x3n' Landau
Damian 'Mozork' Frick

Constructor & Destructor Documentation

orxonox::LevelManager::LevelManager ( )
virtual orxonox::LevelManager::~LevelManager ( )
virtual
orxonox::LevelManager::LevelManager ( const LevelManager )
privatedelete

Member Function Documentation

void orxonox::LevelManager::activateNextLevel ( )
private

Activate the next level.

void orxonox::LevelManager::compileAvailableLevelList ( void  )
private

Compile the list of available Levels.

Level* orxonox::LevelManager::getActiveLevel ( )

Get the currently active Level.

LevelInfoItem* orxonox::LevelManager::getAvailableLevelListItem ( unsigned int  index)

Get the LevelInfoItem at the given index in the list of available Levels.

const std::string& orxonox::LevelManager::getCampaignMission ( unsigned int  index)
inline
const std::string& orxonox::LevelManager::getDefaultLevel ( ) const
inline

Get the default level.

Returns
Returns the filename of the default level.
static LevelManager& orxonox::LevelManager::getInstance ( void  )
inlinestatic

Get the instance of the LevelManager.

Returns
Returns the instance of the LevelManager.
const std::string& orxonox::LevelManager::getLastFinishedCampaignMission ( ) const
inline
unsigned int orxonox::LevelManager::getNumberOfCampaignMissions ( )
inline
unsigned int orxonox::LevelManager::getNumberOfLevels ( void  )
LevelManager& orxonox::LevelManager::operator= ( const LevelManager )
privatedelete
void orxonox::LevelManager::releaseActivity ( Level level)

Release activity for the input Level.

void orxonox::LevelManager::requestActivity ( Level level)

Request activity for the input Level.

void orxonox::LevelManager::setConfigValues ( )

Set the config values for this object.

void orxonox::LevelManager::setDefaultLevel ( const std::string &  levelName)

Set the default Level.

void orxonox::LevelManager::setLastFinishedCampaignMission ( const std::string &  lastFinishedCampaignMission)
void orxonox::LevelManager::updateAvailableLevelList ( void  )
private

Update the list of available Levels.

Friends And Related Function Documentation

friend class Singleton< LevelManager >
friend

Member Data Documentation

std::set<LevelInfoItem*, LevelInfoCompare> orxonox::LevelManager::availableLevels_
private

The set of available Levels sorted alphabetically according to the name of the Level.

std::vector<std::string> orxonox::LevelManager::campaignMissions_
private
std::string orxonox::LevelManager::defaultLevelName_
private

The next expected Level to be accessed.

std::string orxonox::LevelManager::lastFinishedCampaignMission_
private
std::list<Level*> orxonox::LevelManager::levels_
private

A list of all the Levels whose activity has been requested, in the order in which they will become active.

unsigned int orxonox::LevelManager::nextIndex_
private
std::set<LevelInfoItem*, LevelInfoCompare>::iterator orxonox::LevelManager::nextLevel_
private

The next expected index to be accessed.

LevelManager* orxonox::LevelManager::singletonPtr_s
staticprivate

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