Move pathfinders to dedicated files

This commit is contained in:
Jan Mrna
2025-09-28 09:39:40 +02:00
parent 7eee6a5c54
commit c42a6b647e
20 changed files with 430 additions and 377 deletions

View File

@@ -0,0 +1,25 @@
#pragma once
#include <string_view>
#include <unordered_map>
#include "base.hpp"
#include "math.hpp"
namespace pathfinder {
class BFS: public PathFinderBase {
public:
BFS(const Map* m): PathFinderBase(m) {}
Path CalculatePath(WorldPos start, WorldPos end) override;
const std::string_view& GetName() const override { return m_Name; }
private:
const std::string_view m_Name = "Breadth First Search";
std::unordered_map<TilePos, double, TilePosHash> m_Distance;
std::unordered_map<TilePos, TilePos, TilePosHash> m_CameFrom;
};
}