-
-
Notifications
You must be signed in to change notification settings - Fork 112
/
Copy pathcollective_warning.h
52 lines (43 loc) · 1.05 KB
/
collective_warning.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#pragma once
#include "util.h"
#include "game_time.h"
RICH_ENUM(CollectiveWarning,
DIGGING,
RESOURCE_STORAGE,
EQUIPMENT_STORAGE,
LIBRARY,
BEDS,
TRAINING,
TRAINING_UPGRADE,
GUARD_POSTS,
NO_HATCHERY,
WORKSHOP,
NO_WEAPONS,
GRAVES,
CHESTS,
NO_PRISON,
LARGER_PRISON,
TORTURE_ROOM,
MORE_CHESTS,
DUNGEON_LEVEL,
MORE_LIGHTS
);
class Collective;
class CollectiveWarnings {
public:
typedef CollectiveWarning Warning;
void disable();
void considerWarnings(Collective*);
bool isWarning(Warning) const;
void setWarning(Warning, bool state = true);
optional<const char*> getNextWarning(LocalTime localTime);
template <class Archive>
void serialize(Archive& ar, const unsigned int version);
private:
void considerWeaponWarning(Collective*);
void considerTorchesWarning(Collective*);
const char*getText(Warning w);
EnumSet<Warning> SERIAL(warnings);
EnumMap<CollectiveWarning, optional<LocalTime>> SERIAL(warningTimes);
LocalTime SERIAL(lastWarningTime) = LocalTime(100);
};