diff options
Diffstat (limited to 'game/network/routeWalker.h')
-rw-r--r-- | game/network/routeWalker.h | 24 |
1 files changed, 24 insertions, 0 deletions
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 <set> +#include <vector> + +class RouteWalker { +public: + using Solution = std::vector<LinkWPtr>; + + RouteWalker(); + + Solution findRouteTo(const Link::End & currentEnd, const NodePtr & dest); + +private: + void findRouteTo(const Link::End & currentEnd, const NodePtr & dest, float length); + + std::set<const Link::End *> visited; + Solution bestSolution, currentSolution; + float solutionLength; +}; + +#endif |