-
Notifications
You must be signed in to change notification settings - Fork 0
/
board.h
53 lines (48 loc) · 1.16 KB
/
board.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
#ifndef BOARD_H
#define BOARD_H
#include "common.h"
class Board {
public:
Board();
~Board();
Stone get_stone(int x, int y);
void set_stone(int x, int y, Stone s);
int get_score(Stone s);
void set_score(Stone s, int score);
Player get_player(Stone s);
void set_player(Player pB, Player pW);
Coords get_last_move();
void set_last_move(int x, int y);
bool is_last_move(int x, int y);
string get_nickname(Stone s);
void toggle_turn();
Stone last_turn();
Stone whose_turn();
bool in_range(int x, int y);
int make_move(int x, int y);
bool check_quit(int x, int y);
bool check_tied();
bool check_3_3(int x, int y);
bool check_nseq(int x, int y, int quad, int n);
bool check_nseq_open(int x, int y, int quad, int n);
int count_seq(int x, int y, int dx, int dy, bool open = false);
void crunch(int x, int y);
void print_board(VecCoords candy, bool print_candy);
void read_board(string file);
void write_board(string file);
private:
Stone board[N][N];
VecCoords empties;
Stone turn;
Stone last;
Player playerB;
Player playerW;
int scoreB;
int scoreW;
Coords last_move;
public:
int moves;
float eB;
float eW;
};
#endif