-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathboard.h
53 lines (44 loc) · 1.12 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
/*************************
* BOARD.H
* board class declaration
************************/
#ifndef _BOARD_H_
#define _BOARD_H_
#include <vector>
#include "const.h"
using namespace std;
class Board{
public:
class Square{
public:
Square();
Square(char y, char x);
char x, y;
};
class Move{
public:
Move();
Move(char y, char x);
Board::Square square;
bool valid;
vector<Square> flips;
};
Board();
Board(Board &b);
Board(char boardState[8][8], int currentPlayer);
void Print(vector<Board::Move> moves = vector<Board::Move>(), bool computer = false);
bool OnFrontier(int y, int x);
bool TerminalState(bool currentPlayerPass);
bool NextPlayer(bool currentPlayerPass);
void ApplyMove(Board::Move move);
vector<Board::Move> LegalMoves(int player);
void GameOver();
int currentPlayer;
int score[3];
char board[BOARDSIZE][BOARDSIZE];
bool playerPassed;
private:
bool onBoard(const char y, const char x);
bool iterate(char &y, char &x, const int mode, const int direction);
};
#endif //_BOARD_H_