MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / setStat

Method setStat

source/game/StarStatistics.cpp:126–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124}
125
126void 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
136void Statistics::unlockAchievement(String const& name) {
137 if (achievementUnlocked(name))

Callers 1

Calls 4

singletonClass · 0.85
statisticsDatabaseMethod · 0.80
achievementsForStatMethod · 0.80
addAllMethod · 0.45

Tested by

no test coverage detected