-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpath_finding.h
More file actions
34 lines (26 loc) · 778 Bytes
/
path_finding.h
File metadata and controls
34 lines (26 loc) · 778 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
#ifndef path_finding_h
#define path_finding_h
#include "map.h"
#include <vector>
/********************************************************************/
class PathFinding {
public:
PathFinding(MapData* mapdata);
~PathFinding();
std::vector<Position> findPath(Position start, Position end);
protected:
void resetPath();
int getIndex(int x, int y) const;
std::vector<Position> list_actual_neighbours(int x, int y);
Position get_prev_pos(Position position, int step);
bool findWithStep(int step);
private:
bool found_position_ = false;
Position found_;
MapData* map_data_;
int* map_array_ = nullptr;
int width_;
int height_;
};
/********************************************************************/
#endif // path_finding_h