| 124 | } |
| 125 | |
| 126 | void Statistics::setStat(String const& name, String const& type, Json const& value) { |
| 127 | Logger::debug("Stat {} ({}) : {}", name, type, value); |
| 128 | m_stats[name] = Stat { type, value }; |
| 129 | if (m_service) |
| 130 | m_service->setStat(name, type, value); |
| 131 | |
| 132 | auto statisticsDatabase = Root::singleton().statisticsDatabase(); |
| 133 | m_pendingAchievementChecks.addAll(statisticsDatabase->achievementsForStat(name)); |
| 134 | } |
| 135 | |
| 136 | void Statistics::unlockAchievement(String const& name) { |
| 137 | if (achievementUnlocked(name)) |
no test coverage detected