-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathmap.h
44 lines (41 loc) · 1.23 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
#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
{
private:
std::vector<std::vector<int>> grid;
std::vector<gNode> nodes;
std::vector<std::vector<Node>> valid_moves;
int height, width, size;
int connectedness;
double agent_size;
bool map_is_roadmap;
bool check_line(int x1, int y1, int x2, int y2);
bool get_grid(const char* FileName);
bool get_roadmap(const char* FileName);
public:
Map(double size, int k){ agent_size = size; connectedness = k; }
~Map(){}
int get_size() const { return size; }
bool get_map(const char* FileName);
bool is_roadmap() const {return map_is_roadmap;}
bool cell_is_obstacle(int i, int j) const;
int get_width() const {return width;}
gNode get_gNode(int id) const {if(id < int(nodes.size())) return nodes[id]; return gNode();}
int get_id(int i, int j) const;
double get_i (int id) const;
double get_j (int id) const;
std::vector<Node> get_valid_moves(int id) const;
void print_map();
void printPPM();
};
#endif // MAP_H