From afc66d3013b7d47c6c22d6a99809bc3e7d1ff0dc Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Thu, 24 Oct 2024 14:44:20 +0200 Subject: implement breadth-first search pathfinding --- BreadthFirstPathfinder.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 BreadthFirstPathfinder.h (limited to 'BreadthFirstPathfinder.h') 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 + +class BreadthFirstPathfinder : public Pathfinder { + using Pathfinder::Pathfinder; + +public: + virtual void find_between(const XY &, const XY &); + virtual const Path & get_path(); + +private: + std::vector find_step(const std::vector &); + Path solution; + + XY end; + +protected: + virtual void clear(); + +}; + -- cgit v1.2.3