-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathGameState.h
66 lines (57 loc) · 1.74 KB
/
GameState.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
#ifndef GOBAN_VIEWSTATE_H
#define GOBAN_VIEWSTATE_H
#include "Board.h"
class GameState {
public:
Color colorToMove;
std::string black;
std::string white;
int capturedBlack, capturedWhite;
int reservoirBlack, reservoirWhite;
float komi;
int handicap;
float result;
std::string cmd;
std::string err;
enum Message {
NONE, WHITE_PASS, BLACK_PASS, WHITE_RESIGNS, BLACK_RESIGNS,
BLACK_RESIGNED, WHITE_RESIGNED, WHITE_WON, BLACK_WON, PAUSED,
CALCULATING_SCORE
};
Message msg;
GameState(): colorToMove(Color::BLACK), black(""), white(""), capturedBlack(0), capturedWhite(0),
reservoirBlack(32), reservoirWhite(32),
komi(0.5f), handicap(0), result(0.0f), cmd("xxx"), msg(PAUSED),
reason(NOREASON), adata(), metricsReady(false), showTerritory(false), showOverlay(false),
holdsStone(false), dirty(true)
{ }
enum Reason { NOREASON, DOUBLE_PASS, RESIGNATION, INVALID_MOVE } reason;
struct Result {
int black_territory;
int white_territory;
int black_prisoners;
int white_prisoners;
int black_captured;
int white_captured;
int black_area;
int white_area;
float delta;
Reason reason;
Result() :
black_territory(0),
white_territory(0),
black_prisoners(0),
white_prisoners(0),
black_captured(0),
white_captured(0),
black_area(0),
white_area(0),
delta(0.0),
reason(NOREASON)
{ }
} adata;
bool metricsReady;
bool showTerritory, showOverlay, holdsStone;
volatile bool dirty;
};
#endif