-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmap.h
More file actions
36 lines (31 loc) · 855 Bytes
/
map.h
File metadata and controls
36 lines (31 loc) · 855 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
34
35
36
#ifndef MAP_H
#define MAP_H
#include <iostream>
#include <string>
#include <algorithm>
#include <sstream>
#include <fstream>
#include <vector>
#include "tinyxml2.h"
#include "const.h"
#include "structs.h"
class Map
{
public:
std::vector<std::vector<int>> grid;
std::vector<std::vector<std::vector<Step>>> valid_moves;
int height, width;
Map(){}
~Map(){}
bool get_map(const char* FileName);
bool cell_is_traversable (int i, int j) const;
bool cell_on_grid (int i, int j) const;
bool cell_is_obstacle(int i, int j) const;
int get_value(int i, int j) const;
void print_map();
int get_height() const { return height; }
int get_width() const { return width; }
std::vector<Step> get_valid_moves(int i, int j) const;
void generate_moves();
};
#endif // MAP_H