-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBoard.h
56 lines (50 loc) · 1.2 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
56
#pragma once
#include "raylibCpp.h"
#include <vector>
#include "Vec2.h"
class Board
{
private:
class Cell
{
public:
/* Special Member Functions | Cell */
Cell();
/* Public Methods | Cell */
void SetColor(Color color);
void Remove();
/* Getters | Cell*/
Color GetColor() const;
bool Exists() const;
private:
/* Private Fields | Cell */
bool bExists;
Color color;
};
public:
/* Special Member Functions | Board */
/**
@param 1. screePos // space from border of window to board
@param 2. widthHeight // amount of cells in board
@param 3. cellSize // param for both x,y
@param 4. padding // space between cells
*/
Board(Vec2<int> screenPos, Vec2<int> widthHeight, int cellSize, int padding);
/* Public Methods | Board */
void SetCell(Vec2<int> pos, Color color);
void DrawCell(Vec2<int> pos) const;
void DrawCell(Vec2<int> pos, Color color) const;
void DrawBorder() const;
void Draw() const;
bool CellExists(Vec2<int> pos) const;
int GetWidth() const;
int GetHeight() const;
private:
/* Private Fields | Board */
std::vector<Cell> cells;
const int width;
const int height;
const int cellSize;
const int padding; // separators between cells
Vec2<int> screenPos;
};