-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgame.h
79 lines (54 loc) · 1.45 KB
/
game.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
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
// game.hpp ////////////////////////////////////////////////////////////////////
// Game object that contains a dynamic list of periods /////////////////////////
////////////////////////////////////////////////////////////////////////////////
//#include <std_files>
//#include "Headers.h"
//#include "Source.c"
//#include "Headers.hpp"
//#include "Source.cpp"
#ifndef gAmE
#define gAmE
#include "clock.h"
#include "display.h"
#include "pwm.h"
class Game
{ public:
Game(int period_minutes);
Game(const Game& other);
Game& operator =(const Game& other);
private:
Period * periods;
seconds periodLength;
int numberOfPeriods;
int currentPeriod;
// use 1, 2, 3, here, for more readable to hockey fans than the
// programming convention of starting at 0
bool gameEnded;
public:
int getNumberOfPeriods();
//int getCurrentPeriod();
String getCurrentPeriod();
String getClockOutput();
#ifdef PRESEASON
void printClockOutput();
#endif
bool inOvertime();
void Update(seconds deltat);
void Update(seconds deltat, Display &display);
bool newOvertime();
// use return value to catch any "cant allocate more memory"
// exceptions
// maybe we can get away with using exceptions here if we are
// very careful
void startClock();
void stopClock();
void toggleClock();
bool clockIsRunning();
void Goal(player scoredBy);
score getHomeScore();
score getAwayScore();
bool gameFinished();
void gameOver();
~Game();
};
#endif