-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameState.h
More file actions
101 lines (80 loc) · 2.11 KB
/
Copy pathGameState.h
File metadata and controls
101 lines (80 loc) · 2.11 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#ifndef GAMESTATE_H
#define GAMESTATE_H
//statement: the heart of moderation
//I understand it as a label collection of warehouse
enum Location {
DORM,
CCTW,
LIBRARY,
ACADEMIC_BUILDING,
};
enum StudyEventType {
STUDY_EVENT_NONE,
STUDY_EVENT_PHONE,
STUDY_EVENT_HARDWORK,
STUDY_EVENT_STRUGGLE,
STUDY_EVENT_INSPIRATION
};
enum RestEventType {
REST_EVENT_NONE,
REST_EVENT_SLEEPLESS,
REST_EVENT_DEEP_REST
};
struct GameState {
int day;
int ap;
int energy;
int mastery;
Location location;
Location selectedLocation;
};
extern GameState game; // there is a var. game, it's class is GameState
extern const int CONFIRMATION;
extern const int INITIAL_AP;
extern const int INITIAL_ENERGY;
extern const int INITIAL_MASTERY;
extern const int DAYS_TO_EXAM;
extern const int PASS_MASTERY;
extern const int PASS_ENERGY;
extern const int MIN_ENERGY;
extern const int MAX_ENERGY;
extern const int STUDY_MASTERY_GAIN;
extern const int STUDY_ENERGY_COST;
extern const int REST_ENERGY_GAIN;
extern int MASTERY_CHANGE;
extern int ENERGY_CHANGE;
const char* getLocationName(Location loc);
StudyEventType getRandomStudyEvent();
RestEventType getRandomRestEvent();
bool isDayEnd();
bool isGameOver();
bool hasPassedExam();
bool isDie();
bool canConfirmAction();
static bool lastConfirm;
void setupGame();
void applyStudyEvent(StudyEventType event, int& MASTERY_CHANGE, int& ENERGY_CHANGE);
void applyRestEvent(RestEventType event, int& ENERGY_CHANGE);
void performEventAction();
void performLocationAction();
void endDay();
void selectNextLocation();
void selectPrevLocation();
void ap_cost();
void initOLED();
void updateScreen();
void updateEventScreen();
void updateSkillScreen();
void screenShowWarning();
void examLoop();
void examCompleted();
void gameOver1();
void gameOver2();
void updateLocationLEDs(bool showingAction = false);
void updateAPLEDs();
void examLEDs();
void constantLEDs();
void chooseSwitcher();
void confirmSwitcher();
void quickReset();
#endif