pathfinding.hpp (1073B)
1 #pragma once 2 3 #ifndef PATHFINDING_HPP 4 #define PATHFINDING_HPP 5 6 #include <ncurses.h> 7 8 #include <algorithm> 9 #include <map> 10 #include <queue> 11 #include <stack> 12 #include <vector> 13 14 #include "colors.hpp" 15 #include "state.hpp" 16 #include "timer.hpp" 17 #include "vec2.hpp" 18 19 namespace pathfinding { 20 std::vector<vec2<int>> Breadth( 21 const bool* field, 22 const int& width, 23 const int& height, 24 const vec2<int>& start, 25 const std::vector<vec2<int>>& exits); 26 27 std::vector<vec2<int>> Depth( 28 const bool* field, 29 const int& width, 30 const int& height, 31 const vec2<int>& start, 32 const std::vector<vec2<int>>& exits); 33 34 std::vector<vec2<int>> AStar( 35 const bool* field, 36 const int& width, 37 const int& height, 38 const vec2<int>& start, 39 const std::vector<vec2<int>>& exits); 40 }; // pathfinding 41 42 #endif // PATHFINDING_HPP 43 44 extern std::map<std::string, 45 std::vector<vec2<int>> (*)( 46 const bool* field, 47 const int& width, 48 const int& height, 49 const vec2<int>& start, 50 const std::vector<vec2<int>>& exits)> 51 pathfinders;