-
Notifications
You must be signed in to change notification settings - Fork 0
/
Map.h
40 lines (35 loc) · 1.05 KB
/
Map.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
#ifndef __MAP_H__
#define __MAP_H__
#include "Globals.h"
#include <string>
#include <utility>
class Map
{
public:
static Map *GetInstance();
int **GetGrid() const;
int **GetDistFromPlayer() const;
void UpdateDistFromPlayer(int gridX, int gridY, int max);
bool Fog(int x, int y) const;
void UpdateFog(int x, int y);
int GetGridSize() const;
void SetGrid(int **map, int size, std::pair<int,int> startPoint, std::pair<int,int> endPoint);
static void RemoveInstance();
void CreateAuto(int size);
std::pair<int, int> GetEndLoc() const;
std::pair<int, int> GetStartLoc() const;
void Save(std::string filename);
void Load(std::string filename);
private:
Map(int size = GRID_SIZE);
~Map();
bool VerifyLevel();
static Map *instance;
int **map;
int **distFromPlayer;
bool **knownMap;
int size;
std::pair<int, int> startLoc;
std::pair<int, int> endLoc;
};
#endif