aboutsummaryrefslogtreecommitdiff
path: root/BreadthFirstPathfinder.h
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-10-24 14:44:20 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-10-24 14:44:20 +0200
commitafc66d3013b7d47c6c22d6a99809bc3e7d1ff0dc (patch)
treede50baa5d2f87cc8a416cbd321f7c7f430b03613 /BreadthFirstPathfinder.h
parent1e0a52b03fe655d7073ef20703dbb2e7646f74d3 (diff)
implement breadth-first search pathfinding
Diffstat (limited to 'BreadthFirstPathfinder.h')
-rw-r--r--BreadthFirstPathfinder.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/BreadthFirstPathfinder.h b/BreadthFirstPathfinder.h
new file mode 100644
index 0000000..ba05f70
--- /dev/null
+++ b/BreadthFirstPathfinder.h
@@ -0,0 +1,24 @@
+#pragma once
+
+#include "Pathfinder.h"
+
+#include <vector>
+
+class BreadthFirstPathfinder : public Pathfinder {
+ using Pathfinder::Pathfinder;
+
+public:
+ virtual void find_between(const XY &, const XY &);
+ virtual const Path & get_path();
+
+private:
+ std::vector<Path> find_step(const std::vector<Path> &);
+ Path solution;
+
+ XY end;
+
+protected:
+ virtual void clear();
+
+};
+