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 --- Pathfinder.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Pathfinder.h (limited to 'Pathfinder.h') diff --git a/Pathfinder.h b/Pathfinder.h new file mode 100644 index 0000000..9c362dc --- /dev/null +++ b/Pathfinder.h @@ -0,0 +1,33 @@ +#pragma once + +#include +#include + +#include "XY.h" + +class Museum; +class Canvas; + +class Pathfinder { +public: + typedef std::forward_list Path; + +public: + Pathfinder(Museum &); + + virtual void find_between(const XY &, const XY &) = 0; + virtual const Path & get_path() = 0; + + virtual bool is_visited(const XY &); + +protected: + virtual void clear(); + virtual void set_visited(const XY &); + +private: + std::vector visisted; + +protected: + Museum & museum; +}; + -- cgit v1.2.3