aboutsummaryrefslogtreecommitdiff
path: root/DijkstraPathfinder.h
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-10-24 20:46:43 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-10-24 20:46:43 +0200
commitdabfb8188aab86ea8d8c9794ee8e46f6e22291f4 (patch)
tree492f8139c36aa8dc117a7c0de9162a89501c1d84 /DijkstraPathfinder.h
parent2502246d8b08e8660dd08e2c2089c2ef2cf3458b (diff)
fix dijkstra but efficient this time
Diffstat (limited to 'DijkstraPathfinder.h')
-rw-r--r--DijkstraPathfinder.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/DijkstraPathfinder.h b/DijkstraPathfinder.h
index eddb26f..5fb1e21 100644
--- a/DijkstraPathfinder.h
+++ b/DijkstraPathfinder.h
@@ -22,6 +22,11 @@ private:
unsigned int distance = -1;
XY parent;
};
+ struct Neighbor {
+ unsigned int distance = -1;
+ XY position;
+ };
+
Node & map_get(const XY &);
std::unordered_map<XY, Node> map;