-
Notifications
You must be signed in to change notification settings - Fork 1
/
Grid.h
46 lines (36 loc) · 881 Bytes
/
Grid.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
#pragma once
#include "pch.h"
#include "Cell.h"
#include "CellPoint.h"
#include "AStar.h"
class Grid {
public:
Cell cellMatrix[27][27];
int getNeighbours(int x, int z);
void initializeGrid();
void nextGeneration();
bool GetInitialised();
void SetInitialised(bool state);
void Clear();
int Size();
Cell GetTreasureCell();
Cell GetPlayerCell();
//AStar
int* GetDistance();
void ResetPlayerInStateMatrix(int,int);
std::vector<CellPoint> haveChanged;
private:
const int gridSize = 27;
const int probabilityToBeAlive = 30;
bool gridInitialised = false;
bool m_isPlayerSet, m_isTreasureSet;
Cell m_cellTreasure;
Cell m_cellPlayer;
AStar m_aStar;
std::pair<int,int> m_treasureIndex;
std::pair<int, int> m_playerIndex;
int stateMatrix[27][27];
bool m_LevelSolvable;
bool m_distance;
int m_searchResult;
};