-
Notifications
You must be signed in to change notification settings - Fork 0
/
GameEngine.h
51 lines (43 loc) · 1.02 KB
/
GameEngine.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
#ifndef ASSIGN2_GAMEENGINE_H
#define ASSIGN2_GAMEENGINE_H
#include <string>
#include "LinkedList.h"
#include "Display.h"
#include "Player.h"
#include "Board.h"
#define MAX_ARGS 4
#define PLACE "place"
#define REPLACE "replace"
#define SAVE "save"
#define AT "at"
#define NO_ERROR ""
class GameEngine {
public:
void start();
private:
std::string errorMessage;
typedef struct Tokens_t
{
std::string command;
std::string tileCode;
std::string boardLoc;
std::string saveFile;
};
Player* currentPlayer;
Player player1;
Player player2;
LinkedList tileBag;
Board board;
Display display;
Tokens_t tokens;
bool parseInput(std::string input);
bool validColour(char colour);
bool validTile(std::string tileCode);
bool validShape(int shape);
bool validLoc(std::string location);
bool executeCommand();
bool gameIsOver();
void checkError();
bool save();
};
#endif // ASSIGN2_GAMEENGINE_H