From 56782dbb368117faaddda0a45ca2ecb753af90d7 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 13 Mar 2021 14:42:37 +0000 Subject: Initial commit of the route finder --- game/network/routeWalker.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 game/network/routeWalker.h (limited to 'game/network/routeWalker.h') diff --git a/game/network/routeWalker.h b/game/network/routeWalker.h new file mode 100644 index 0000000..7b1e1c8 --- /dev/null +++ b/game/network/routeWalker.h @@ -0,0 +1,24 @@ +#ifndef ROUTEWALKER_H +#define ROUTEWALKER_H + +#include "link.h" +#include +#include + +class RouteWalker { +public: + using Solution = std::vector; + + RouteWalker(); + + Solution findRouteTo(const Link::End & currentEnd, const NodePtr & dest); + +private: + void findRouteTo(const Link::End & currentEnd, const NodePtr & dest, float length); + + std::set visited; + Solution bestSolution, currentSolution; + float solutionLength; +}; + +#endif -- cgit v1.2.3