#include <achievements.h>
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 AchievementDescription * | getAchievementDescription (uint16 index) const |
| uint16 | getStatCount () const |
| const StatDescription * | getStatDescription (uint16 index) const |
Additional Inherited Members | |
Static Public Member Functions inherited from Common::Singleton< AchievementsManager > | |
| static bool | hasInstance () |
| static AchievementsManager & | instance () |
| static void | destroy () |
Protected Types inherited from Common::Singleton< AchievementsManager > | |
| typedef AchievementsManager | SingletonBaseType |
Static Protected Attributes inherited from Common::Singleton< AchievementsManager > | |
| static AchievementsManager * | _singleton |
Class for manipulating the achievements.
Use the Achievements Manager class to edit the in-game achievements.
| 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.
| [in] | info | Achievements platform type and application ID. |
| bool Common::AchievementsManager::setAchievement | ( | const String & | id | ) |
Set an achievement. Message is automatically displayed with text from active domain.
| [in] | id | Internal ID of the achievement. |
| bool Common::AchievementsManager::isAchieved | ( | const String & | id | ) | const |
Check if an achievement as achieved.
| [in] | id | Internal ID of the achievement. |
| bool Common::AchievementsManager::clearAchievement | ( | const String & | id | ) |
Clear an achieved achievement.
| [in] | id | Internal ID of the achievement. |
| int Common::AchievementsManager::getStatInt | ( | const String & | id | ) | const |
Get a statistic (integer).
| [in] | id | Internal ID of the achievement. |
| bool Common::AchievementsManager::setStatInt | ( | const String & | id, |
| int | value | ||
| ) |
Set a statistic to an integer number.
| [in] | id | Internal ID of the achievement. |
| [in] | value | Value to which the statistic is set. |
| float Common::AchievementsManager::getStatFloat | ( | const String & | id | ) | const |
Get a statistic (float).
| [in] | id | Internal ID of the achievement. |
| bool Common::AchievementsManager::setStatFloat | ( | const String & | id, |
| float | value | ||
| ) |
Set a statistic to a float number.
| [in] | id | Internal ID of the achievement. |
| [in] | value | Value to which the statistic is set. |
Get a statistic (raw string).
| [in] | id | Internal ID of the achievement. |
| 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.
| [in] | id | Internal ID of the achievement. |
| bool Common::AchievementsManager::updateAverageRateStatFloat | ( | const String & | id, |
| float | count, | ||
| float | times | ||
| ) |
Store provided key and value pair in additional section. May be useful for posting achievements to original platform.
| [in] | id | Internal ID of the achievement. |
| [in] | value | Value to which the statistic is set. |
| uint16 Common::AchievementsManager::getAchievementCount | ( | ) | const |
Get number of achievement descriptions available.
| const AchievementDescription* Common::AchievementsManager::getAchievementDescription | ( | uint16 | index | ) | const |
Get achievement description by index.
| [in] | index | Internal index of the achievement, counted from 0 to (getAchievementCount() - 1) |
| uint16 Common::AchievementsManager::getStatCount | ( | ) | const |
Get number of stat descriptions available.
| const StatDescription* Common::AchievementsManager::getStatDescription | ( | uint16 | index | ) | const |
Get stat description by index.
| [in] | index | Internal index of the stat, counted from 0 to (getStatCount() - 1) |