-
Notifications
You must be signed in to change notification settings - Fork 0
/
board.h
55 lines (48 loc) · 1.24 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
54
55
#include <SDL2pp/SDL2pp.hh>
#include "primitives.h"
struct Cell {
bool north;
bool south;
bool east;
bool west;
Cell() {
north = false,south = false,east = false,west = false;
}
};
struct Point {
int row;
int col;
bool OnGrid;
};
class Board {
private:
Cell **board;
int rowCount;
int columnCount;
int width;
int height;
public:
Board(int w, int h){
width = w;
height = h;
rowCount = 7;
columnCount = 10;
board = new Cell*[rowCount];
for(int i = 0; i < rowCount; ++i){
board[i] = new Cell[columnCount];
}
SetLevelBarriers();
}
~Board() {
for(int i = 0; i < rowCount; ++i) {
delete board[i];
}
delete board;
}
void SetLevelBarriers();
Primitives::Location getMidPointOfCell(int row,int col);
void drawGrid(SDL2pp::Renderer &input);
void drawboarders(SDL2pp::Renderer &input);
Point GetCellForXAndY(int x, int y);
void drawSinglecell(SDL2pp::Renderer &input,int row,int col,int thickness,Primitives::Direction direction);
};