-
Notifications
You must be signed in to change notification settings - Fork 0
/
Game.h
59 lines (43 loc) · 1.15 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
#pragma once
#define PLAYER_RED 1
#define PLAYER_BLACK 0
#define max_x 50
#define max_y 22
#include "ChessBoard.h"
using namespace std;
typedef vector<BattleArea> BattleHistory;
typedef vector<string> BattleReport;
class Game
{
public:
Game();
Game(const string &fileName);
void saveFile(const string &fileName);
void loadFile(const string &fileName);
ChessBoard &getboard();
const int isCheckmate();
const bool isCheck();
vector<Coord> promptMovement(Coord);
vector<Coord> promptCapture(Coord);
void writeReport(Coord,Coord);
void writeHistory(const BattleArea &oldArea);
void switchPlayer();
BattleReport getReport();
const uint16_t playerNow() const;
void undo();
void redo();
static void controll(const int32_t &xOffset, const int32_t &yOffSet);
static void controll(const int32_t &specified);
static Coord getController();
private:
// Store old battle area
BattleHistory history;
// Store battle report(text)
BattleReport report;
// player's identity
uint16_t player;
// Chess board
ChessBoard board;
// Controller's coord
static Coord controller;
};