Add forgotten pathfinder file
This commit is contained in:
parent
e6fc4e881c
commit
76f10725ec
32
cpp/src/pathfinder.cpp
Normal file
32
cpp/src/pathfinder.cpp
Normal 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
|
Loading…
x
Reference in New Issue
Block a user