-
Notifications
You must be signed in to change notification settings - Fork 2
/
map.h
54 lines (41 loc) · 1.1 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef MAP_H
#define MAP_H
#include <iostream>
#include "node.h"
#include "gl_const.h"
#include <list>
#include "searchresult.h"
#include "tinyxml2.h"
#include <sstream>
#include <string>
#include <algorithm>
#include <random>
class Map
{
public:
Map();
Map(const Map& orig);
~Map();
Changes DamageTheMap(std::list<Node> path, float obstacleposition);
bool GetMap(const char *name);
bool CellIsTraversable (int curr_i, int curr_j) const;
bool CellOnGrid (int curr_i, int curr_j) const;
bool CellIsObstacle(int curr_i, int curr_j) const;
int * operator [] (int i);
const int * operator [] (int i) const;
void PrintPath(std::list<Node> path);
void PrintMap();
const int get_height() const;
const int get_width() const;
double get_cellsize() const;
int start_i, start_j;
int goal_i, goal_j;
private:
int ** Grid;
void BuildGrid();
Node damaged;
int height, width;
double CellSize;
std::string filename;
};
#endif