Add forgotten pathfinder file

This commit is contained in:
Jan Mrna 2025-09-27 18:23:13 +02:00
parent e6fc4e881c
commit 76f10725ec

32
cpp/src/pathfinder.cpp Normal file
View File

@ -0,0 +1,32 @@
#include <memory>
#include <cassert>
#include "pathfinder.hpp"
#include "log.hpp"
namespace pathfinder {
void PathFinderBase::SetMap(std::shared_ptr<Map> map)
{
m_Map = map;
}
Path LinearPathFinder::CalculatePath(WorldPos target)
{
auto path = Path{target};
return path;
}
std::unique_ptr<PathFinderBase> create(PathFinderType type) {
switch (type) {
case PathFinderType::LINEAR:
return std::move(std::make_unique<LinearPathFinder>());
case PathFinderType::BFS:
case PathFinderType::COUNT:
LOG_WARNING("Incorrect pathfinder type");
return nullptr;
};
return nullptr;
}
} // pathfinder namespace