diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-24 14:44:20 +0200 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-24 14:44:20 +0200 |
commit | afc66d3013b7d47c6c22d6a99809bc3e7d1ff0dc (patch) | |
tree | de50baa5d2f87cc8a416cbd321f7c7f430b03613 /Pathfinder.h | |
parent | 1e0a52b03fe655d7073ef20703dbb2e7646f74d3 (diff) |
implement breadth-first search pathfinding
Diffstat (limited to 'Pathfinder.h')
-rw-r--r-- | Pathfinder.h | 33 |
1 files changed, 33 insertions, 0 deletions
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 <vector> +#include <forward_list> + +#include "XY.h" + +class Museum; +class Canvas; + +class Pathfinder { +public: + typedef std::forward_list<XY> 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<bool> visisted; + +protected: + Museum & museum; +}; + |