diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-24 18:32:55 +0200 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-24 18:32:55 +0200 |
commit | faa82f0a6004026c94a6415baf5e138b48dc1629 (patch) | |
tree | ead573bf9ec72a74569b79724c732c17dd9d0fb3 /PathfindingContext.h | |
parent | afc66d3013b7d47c6c22d6a99809bc3e7d1ff0dc (diff) |
implement weird dijkstra
Diffstat (limited to 'PathfindingContext.h')
-rw-r--r-- | PathfindingContext.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/PathfindingContext.h b/PathfindingContext.h index 7c7f173..bb6fc23 100644 --- a/PathfindingContext.h +++ b/PathfindingContext.h @@ -1,6 +1,7 @@ #pragma once #include <memory> +#include <unordered_map> #include <vector> #include "XY.h" @@ -17,10 +18,16 @@ public: const XY & get_start() { return this->start_point; } void set_end(const XY & point); const XY & get_end() { return this->end_point; } - bool valid_point(const XY & point); + bool empty_point(const XY & point); void update(); +public: + void register_weight(const std::string & type, unsigned int weight); + unsigned int get_weight(const std::string & type); +private: + std::unordered_map<std::string, unsigned int> weight_map; + private: XY start_point = { -1, -1 }; XY end_point = { -1, -1 }; |