-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathGrid.h
More file actions
50 lines (45 loc) · 1.07 KB
/
Grid.h
File metadata and controls
50 lines (45 loc) · 1.07 KB
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
/*
Group Member1: Malik Talha Saeed - 19I-0413(D)
Group Member2: Hammad Ahmed - 19I-0582(D)
*/
#ifndef GRID_H
#define GRID_H
#include <iostream>
#include <string>
#include "Token.h"
#include "Player.cpp"
struct Coordinates
{
int x;
int y;
};
class Grid
{
private:
void*** board;
int xDimension;
int yDimension;
public:
Grid()
{
this->xDimension = 15;
this->yDimension = 15;
board = new void**[this->yDimension];
for(int i=0; i<15; i++)
{
board[i] = new void*[this->xDimension];
}
for(int i=0; i<15; i++)
{
for(int j=0; j<15; j++)
{
board[i][j] = nullptr;
}
}
}
void updateGrid(int diceValue, Player& player, int tokenNum, int& errorStatus);
bool isAreaSafe(int cellNo);
bool isInVictoryPath(int cellNo, const std::string& color);
Coordinates get2DCoordinates(int cellNo);
};
#endif