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

#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/orxonox/Highscore.h>

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

Public Member Functions

 Highscore ()
 
int getHighestScoreOfGame (const std::string &game)
 Returns highest score of given game, if exists. More...
 
const std::string & getHighscore (unsigned int index)
 
unsigned int getNumberOfHighscores ()
 
void setConfigValues ()
 set the config values in the orxonox.ini file More...
 
bool storeScore (const std::string &level, int points, PlayerInfo *player)
 stores a new highscore in the orxonox.ini file if the new score is better than the highest score so far. More...
 
- 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 HighscoregetInstance ()
 
- Static Public Member Functions inherited from orxonox::Singleton< Highscore >
static bool exists ()
 Tells whether the singleton has been created. More...
 
static HighscoregetInstance ()
 Returns a reference to the singleton instance. More...
 

Private Attributes

std::vector< std::string > highscores_
 

Static Private Attributes

static HighscoresingletonPtr_s
 

Friends

class Singleton< Highscore >
 

Additional Inherited Members

- Protected Member Functions inherited from orxonox::Singleton< Highscore >
 Singleton ()
 Constructor sets the singleton instance pointer. More...
 
virtual ~Singleton ()
 Destructor resets the singleton instance pointer. More...
 

Constructor & Destructor Documentation

orxonox::Highscore::Highscore ( )

Member Function Documentation

int orxonox::Highscore::getHighestScoreOfGame ( const std::string &  game)

Returns highest score of given game, if exists.

Else returns -1.

const std::string& orxonox::Highscore::getHighscore ( unsigned int  index)
inline
static Highscore& orxonox::Highscore::getInstance ( void  )
inlinestatic
unsigned int orxonox::Highscore::getNumberOfHighscores ( )
inline
void orxonox::Highscore::setConfigValues ( void  )

set the config values in the orxonox.ini file

bool orxonox::Highscore::storeScore ( const std::string &  level,
int  points,
PlayerInfo player 
)

stores a new highscore in the orxonox.ini file if the new score is better than the highest score so far.

Returns
true if the given score marks a new high score

Friends And Related Function Documentation

friend class Singleton< Highscore >
friend

Member Data Documentation

std::vector<std::string> orxonox::Highscore::highscores_
private
Highscore* orxonox::Highscore::singletonPtr_s
staticprivate

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