-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGame.h
56 lines (42 loc) · 1.16 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
#include "Player.h"
#include "FieldInfo.h"
#include "TUITerminal.h"
#include <cstdlib>
#include <string>
#include <vector>
using std::vector;
class Game {
private:
bool isGui;
static Terminal* term;
public:
//constructor
Game(bool graphic = false);
Game(bool graphic, bool useDefault);
bool active = true; //if the game is in an ongoing, healthy state.
void step(); //makes the game move forward a step
string getMessage(); //see if the game has anything to report.
private:
vector<FieldInfo> history;
vector<Player*> players;
Pile drawPile;
Pile trashPile;
Pile buildPiles[4];
int turn;
string message;
const string HEALTHY = "The game is running in a healthy state!";
const string ABNORMAL = "The game is not in a normal state.";
const string ENDED = "The game has ended!";
//saves current state of the game into a FieldInfo
FieldInfo writeState();
//take trash pile and put it into deck
bool trashToDeck();
//take completed build pile and put it into trash pile
bool buildToTrash(int num); //specifies which build pile to empty
void undo();
void redo();
//Save
void save(std::string name);
//Restore
void restore(std::string filename);
};