Cuberite
A lightweight, fast and extensible game server for Minecraft
StatisticsManager.cpp
Go to the documentation of this file.
1 
2 // Statistics.cpp
3 
4 #include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
5 
6 #include "StatisticsManager.h"
7 
8 
9 
10 
11 
13 {
14  switch (a_Stat)
15  {
16  case CustomStatistic::AchOpenInventory: return true;
49  default: UNREACHABLE("Unsupported achievement type");
50  }
51 }
52 
53 
54 
55 
56 
58 {
59  const auto Result = Custom.find(a_Stat);
60  if (Result != Custom.end())
61  {
62  return Result->second > 0;
63  }
64  return false;
65 }
#define UNREACHABLE(x)
Definition: Globals.h:288
CustomStatistic
bool SatisfiesPrerequisite(CustomStatistic a_Stat) const
Returns whether the prerequisite for awarding an achievement are satisfied.
bool IsStatisticPresent(CustomStatistic a_Stat) const
Returns if a statistic is both present and has nonzero value.
std::unordered_map< CustomStatistic, StatValue > Custom