Cuberite
A lightweight, fast and extensible game server for Minecraft
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
z
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
z
Variables
Typedefs
Enumerations
a
e
f
h
i
l
m
n
o
p
s
t
w
Enumerator
a
b
c
e
f
g
h
i
l
m
o
p
r
s
t
v
w
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
c
d
e
m
n
p
s
v
w
Enumerator
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
v
w
Related Functions
:
b
c
d
e
f
h
i
l
m
n
p
r
s
t
Files
File List
File Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
Variables
b
c
d
g
i
m
n
o
p
q
r
s
t
Typedefs
a
b
c
e
f
h
i
l
m
n
o
p
r
s
t
u
v
w
x
Enumerations
b
c
d
e
i
m
s
Enumerator
a
b
d
e
g
i
m
n
p
r
s
t
w
x
y
z
Macros
a
b
c
d
e
f
g
h
i
j
k
l
m
n
p
r
s
t
u
v
w
x
src
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
12
bool
StatisticsManager::SatisfiesPrerequisite
(
const
CustomStatistic
a_Stat)
const
13
{
14
switch
(a_Stat)
15
{
16
case
CustomStatistic::AchOpenInventory
:
return
true
;
17
case
CustomStatistic::AchMineWood
:
return
IsStatisticPresent
(
CustomStatistic::AchOpenInventory
);
18
case
CustomStatistic::AchBuildWorkBench
:
return
IsStatisticPresent
(
CustomStatistic::AchMineWood
);
19
case
CustomStatistic::AchBuildHoe
:
return
IsStatisticPresent
(
CustomStatistic::AchBuildWorkBench
);
20
case
CustomStatistic::AchBakeCake
:
return
IsStatisticPresent
(
CustomStatistic::AchBuildHoe
);
21
case
CustomStatistic::AchMakeBread
:
return
IsStatisticPresent
(
CustomStatistic::AchBuildHoe
);
22
case
CustomStatistic::AchBuildSword
:
return
IsStatisticPresent
(
CustomStatistic::AchBuildWorkBench
);
23
case
CustomStatistic::AchKillCow
:
return
IsStatisticPresent
(
CustomStatistic::AchBuildSword
);
24
case
CustomStatistic::AchFlyPig
:
return
IsStatisticPresent
(
CustomStatistic::AchKillCow
);
25
case
CustomStatistic::AchBreedCow
:
return
IsStatisticPresent
(
CustomStatistic::AchKillCow
);
26
case
CustomStatistic::AchKillEnemy
:
return
IsStatisticPresent
(
CustomStatistic::AchBuildSword
);
27
case
CustomStatistic::AchSnipeSkeleton
:
return
IsStatisticPresent
(
CustomStatistic::AchKillEnemy
);
28
case
CustomStatistic::AchBuildPickaxe
:
return
IsStatisticPresent
(
CustomStatistic::AchBuildWorkBench
);
29
case
CustomStatistic::AchBuildBetterPickaxe
:
return
IsStatisticPresent
(
CustomStatistic::AchBuildPickaxe
);
30
case
CustomStatistic::AchBuildFurnace
:
return
IsStatisticPresent
(
CustomStatistic::AchBuildWorkBench
);
31
case
CustomStatistic::AchCookFish
:
return
IsStatisticPresent
(
CustomStatistic::AchBuildFurnace
);
32
case
CustomStatistic::AchAcquireIron
:
return
IsStatisticPresent
(
CustomStatistic::AchBuildFurnace
);
33
case
CustomStatistic::AchOnARail
:
return
IsStatisticPresent
(
CustomStatistic::AchAcquireIron
);
34
case
CustomStatistic::AchDiamonds
:
return
IsStatisticPresent
(
CustomStatistic::AchAcquireIron
);
35
case
CustomStatistic::AchPortal
:
return
IsStatisticPresent
(
CustomStatistic::AchDiamonds
);
36
case
CustomStatistic::AchGhast
:
return
IsStatisticPresent
(
CustomStatistic::AchPortal
);
37
case
CustomStatistic::AchBlazeRod
:
return
IsStatisticPresent
(
CustomStatistic::AchPortal
);
38
case
CustomStatistic::AchPotion
:
return
IsStatisticPresent
(
CustomStatistic::AchBlazeRod
);
39
case
CustomStatistic::AchTheEnd
:
return
IsStatisticPresent
(
CustomStatistic::AchBlazeRod
);
40
case
CustomStatistic::AchTheEnd2
:
return
IsStatisticPresent
(
CustomStatistic::AchTheEnd
);
41
case
CustomStatistic::AchEnchantments
:
return
IsStatisticPresent
(
CustomStatistic::AchDiamonds
);
42
case
CustomStatistic::AchOverkill
:
return
IsStatisticPresent
(
CustomStatistic::AchEnchantments
);
43
case
CustomStatistic::AchBookcase
:
return
IsStatisticPresent
(
CustomStatistic::AchEnchantments
);
44
case
CustomStatistic::AchExploreAllBiomes
:
return
IsStatisticPresent
(
CustomStatistic::AchTheEnd
);
45
case
CustomStatistic::AchSpawnWither
:
return
IsStatisticPresent
(
CustomStatistic::AchTheEnd2
);
46
case
CustomStatistic::AchKillWither
:
return
IsStatisticPresent
(
CustomStatistic::AchSpawnWither
);
47
case
CustomStatistic::AchFullBeacon
:
return
IsStatisticPresent
(
CustomStatistic::AchKillWither
);
48
case
CustomStatistic::AchDiamondsToYou
:
return
IsStatisticPresent
(
CustomStatistic::AchDiamonds
);
49
default
:
UNREACHABLE
(
"Unsupported achievement type"
);
50
}
51
}
52
53
54
55
56
57
bool
StatisticsManager::IsStatisticPresent
(
const
CustomStatistic
a_Stat)
const
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
}
Globals.h
UNREACHABLE
#define UNREACHABLE(x)
Definition:
Globals.h:288
CustomStatistic
CustomStatistic
Definition:
CustomStatistics.h:5
CustomStatistic::AchOpenInventory
@ AchOpenInventory
CustomStatistic::AchBuildSword
@ AchBuildSword
CustomStatistic::AchFullBeacon
@ AchFullBeacon
CustomStatistic::AchGhast
@ AchGhast
CustomStatistic::AchKillWither
@ AchKillWither
CustomStatistic::AchPortal
@ AchPortal
CustomStatistic::AchBreedCow
@ AchBreedCow
CustomStatistic::AchKillCow
@ AchKillCow
CustomStatistic::AchExploreAllBiomes
@ AchExploreAllBiomes
CustomStatistic::AchBookcase
@ AchBookcase
CustomStatistic::AchBuildWorkBench
@ AchBuildWorkBench
CustomStatistic::AchBuildBetterPickaxe
@ AchBuildBetterPickaxe
CustomStatistic::AchFlyPig
@ AchFlyPig
CustomStatistic::AchSnipeSkeleton
@ AchSnipeSkeleton
CustomStatistic::AchMineWood
@ AchMineWood
CustomStatistic::AchDiamondsToYou
@ AchDiamondsToYou
CustomStatistic::AchMakeBread
@ AchMakeBread
CustomStatistic::AchPotion
@ AchPotion
CustomStatistic::AchBakeCake
@ AchBakeCake
CustomStatistic::AchBuildFurnace
@ AchBuildFurnace
CustomStatistic::AchTheEnd2
@ AchTheEnd2
CustomStatistic::AchKillEnemy
@ AchKillEnemy
CustomStatistic::AchEnchantments
@ AchEnchantments
CustomStatistic::AchAcquireIron
@ AchAcquireIron
CustomStatistic::AchOnARail
@ AchOnARail
CustomStatistic::AchBlazeRod
@ AchBlazeRod
CustomStatistic::AchCookFish
@ AchCookFish
CustomStatistic::AchOverkill
@ AchOverkill
CustomStatistic::AchDiamonds
@ AchDiamonds
CustomStatistic::AchBuildHoe
@ AchBuildHoe
CustomStatistic::AchBuildPickaxe
@ AchBuildPickaxe
CustomStatistic::AchSpawnWither
@ AchSpawnWither
CustomStatistic::AchTheEnd
@ AchTheEnd
StatisticsManager.h
StatisticsManager::SatisfiesPrerequisite
bool SatisfiesPrerequisite(CustomStatistic a_Stat) const
Returns whether the prerequisite for awarding an achievement are satisfied.
Definition:
StatisticsManager.cpp:12
StatisticsManager::IsStatisticPresent
bool IsStatisticPresent(CustomStatistic a_Stat) const
Returns if a statistic is both present and has nonzero value.
Definition:
StatisticsManager.cpp:57
StatisticsManager::Custom
std::unordered_map< CustomStatistic, StatValue > Custom
Definition:
StatisticsManager.h:38
Generated on Fri Oct 25 2024 05:01:18 for Cuberite by
1.9.1