ScummVM API documentation
Common::AchievementsManager Class Reference

#include <achievements.h>

Inheritance diagram for Common::AchievementsManager:
Common::Singleton< AchievementsManager > Common::NonCopyable

Public Member Functions

bool setActiveDomain (const AchievementsInfo &info)
 
bool unsetActiveDomain ()
 Unset the current active domain.
 
bool isReady () const
 Check whether the domain is ready.
 
Methods for manipulating individual achievements
bool setAchievement (const String &id)
 
bool isAchieved (const String &id) const
 
bool clearAchievement (const String &id)
 
Methods for manipulating individual statistics
int getStatInt (const String &id) const
 
bool setStatInt (const String &id, int value)
 
float getStatFloat (const String &id) const
 
bool setStatFloat (const String &id, float value)
 
const String getStatRaw (const String &id) const
 
float getAverageRateStatFloat (const String &id) const
 
bool updateAverageRateStatFloat (const String &id, float count, float times)
 
Methods for resetting achievements and statistics
bool resetAllAchievements ()
 Reset all achievements.
 
bool resetAllStats ()
 Reset all statistics.
 
Methods for storing platform-specific data
bool setSpecialString (const String &id, const String &value)
 
Methods for getting achievements and statistics descriptions
uint16 getAchievementCount () const
 
const AchievementDescriptiongetAchievementDescription (uint16 index) const
 
uint16 getStatCount () const
 
const StatDescriptiongetStatDescription (uint16 index) const
 

Additional Inherited Members

- Static Public Member Functions inherited from Common::Singleton< AchievementsManager >
static bool hasInstance ()
 
static AchievementsManagerinstance ()
 
static void destroy ()
 
- Protected Types inherited from Common::Singleton< AchievementsManager >
typedef AchievementsManager SingletonBaseType
 
- Static Protected Attributes inherited from Common::Singleton< AchievementsManager >
static AchievementsManager_singleton
 

Detailed Description

Class for manipulating the achievements.

Use the Achievements Manager class to edit the in-game achievements.

Member Function Documentation

◆ setActiveDomain()

bool Common::AchievementsManager::setActiveDomain ( const AchievementsInfo info)

Set a game targeted by platform type and application ID as active domain. Automaticly loads messages texts from achievements.dat.

Parameters
[in]infoAchievements platform type and application ID.

◆ setAchievement()

bool Common::AchievementsManager::setAchievement ( const String id)

Set an achievement. Message is automatically displayed with text from active domain.

Parameters
[in]idInternal ID of the achievement.

◆ isAchieved()

bool Common::AchievementsManager::isAchieved ( const String id) const

Check if an achievement as achieved.

Parameters
[in]idInternal ID of the achievement.

◆ clearAchievement()

bool Common::AchievementsManager::clearAchievement ( const String id)

Clear an achieved achievement.

Parameters
[in]idInternal ID of the achievement.

◆ getStatInt()

int Common::AchievementsManager::getStatInt ( const String id) const

Get a statistic (integer).

Parameters
[in]idInternal ID of the achievement.

◆ setStatInt()

bool Common::AchievementsManager::setStatInt ( const String id,
int  value 
)

Set a statistic to an integer number.

Parameters
[in]idInternal ID of the achievement.
[in]valueValue to which the statistic is set.

◆ getStatFloat()

float Common::AchievementsManager::getStatFloat ( const String id) const

Get a statistic (float).

Parameters
[in]idInternal ID of the achievement.

◆ setStatFloat()

bool Common::AchievementsManager::setStatFloat ( const String id,
float  value 
)

Set a statistic to a float number.

Parameters
[in]idInternal ID of the achievement.
[in]valueValue to which the statistic is set.

◆ getStatRaw()

const String Common::AchievementsManager::getStatRaw ( const String id) const

Get a statistic (raw string).

Parameters
[in]idInternal ID of the achievement.

◆ getAverageRateStatFloat()

float Common::AchievementsManager::getAverageRateStatFloat ( const String id) const

Get an average rate statistic (float). Calcucated by devision the sum of count by the sum of times.

Parameters
[in]idInternal ID of the achievement.

◆ updateAverageRateStatFloat()

bool Common::AchievementsManager::updateAverageRateStatFloat ( const String id,
float  count,
float  times 
)

Update an average rate statistic (float).

Parameters
[in]idInternal ID of the achievement.
[in]countValue to which the statistic count is increased.
[in]timesValue to which the statistic times is increased.

◆ setSpecialString()

bool Common::AchievementsManager::setSpecialString ( const String id,
const String value 
)

Store provided key and value pair in additional section. May be useful for posting achievements to original platform.

Parameters
[in]idInternal ID of the achievement.
[in]valueValue to which the statistic is set.

◆ getAchievementCount()

uint16 Common::AchievementsManager::getAchievementCount ( ) const

Get number of achivement descriptions available.

◆ getAchievementDescription()

const AchievementDescription* Common::AchievementsManager::getAchievementDescription ( uint16  index) const

Get achivement description by index.

Parameters
[in]indexInternal index of the achievement, counted from 0 to (getAchievementCount() - 1)

◆ getStatCount()

uint16 Common::AchievementsManager::getStatCount ( ) const

Get number of stat descriptions available.

◆ getStatDescription()

const StatDescription* Common::AchievementsManager::getStatDescription ( uint16  index) const

Get stat description by index.

Parameters
[in]indexInternal index of the stat, counted from 0 to (getStatCount() - 1)

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