#include #include "Pathfinder.h" #include "Museum.h" using namespace std; Pathfinder::Pathfinder(Museum & m) : museum(m) { } void Pathfinder::set_visited(const XY & point) { this->visisted[point.y * this->museum.canvas.data.columns + point.x] = true; } bool Pathfinder::is_visited(const XY & point) { size_t idx = point.y * this->museum.canvas.data.columns + point.x; if (idx >= this->visisted.size()) return false; return this->visisted[idx]; } void Pathfinder::clear() { CanvasData & canvas = this->museum.canvas.data; this->visisted.resize(canvas.columns * canvas.rows); fill(this->visisted.begin(), this->visisted.end(), false); }