-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMap.h
More file actions
34 lines (28 loc) · 804 Bytes
/
Map.h
File metadata and controls
34 lines (28 loc) · 804 Bytes
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
#pragma once
// The map class holds the data for the traversable space
class Map
{
public:
// Map constructor and destructor
Map() {};
~Map() {};
// The 2-dimensional array that holds the playspace
// 1 represents walkable space, 0 represents non-walkable space
int MapGrid[5][5] = { {1, 1, 1, 1, 1},
{1, 1, 1, 1, 1},
{1, 1, 1, 1, 1},
{1, 1, 1, 1, 1},
{1, 1, 1, 1, 1} };
private:
// The start and end co-ordinates for the path
int StartSpace = 0;
int EndSpace = 24;
public:
// Getters for a safe start/end request
int GetStart() { return this->StartSpace; };
int GetEnd() { return this->EndSpace; };
// Converts a grid index to a coordinate
int* GetGridCoord(int Index = 0);
// Converts a grid coordinate to an index
int GetGridIndex(int* Coord);
};