-
Notifications
You must be signed in to change notification settings - Fork 0
/
Board.h
42 lines (32 loc) · 886 Bytes
/
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
#ifndef _BOARD_H_
#define _BOARD_H_
#include "Player.h"
#include <vector>
#define ROW 6
#define COL 6
class Board {
public:
Board();
// Inline Member Functions
int get_rows() const {return rows_; }
int get_cols() const {return cols_; }
bool get_visited(int row, int col) {return visited_[row][col]; }
// Setters & Getters
void set_visited(int row, int col, bool val);
SquareType get_square_value(Position pos) const;
bool get_won() const {return won_; }
void SetSquareValue(Position pos, SquareType value);
SquareType GetExitOccupant();
// Public Methods
std::vector<Position> GetMoves(Player *p);
bool MovePlayer(Player *p, Position pos);
// Overloads
friend std::ostream& operator<<(std::ostream& os, const Board &b);
private:
SquareType arr_[ROW][COL];
int rows_;
int cols_;
bool won_;
bool visited_[ROW][COL];
}; // class Board
#endif // _BOARD_H_