diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-03-13 14:42:37 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-03-13 14:42:37 +0000 |
commit | 56782dbb368117faaddda0a45ca2ecb753af90d7 (patch) | |
tree | b80b09f507fe3932c0404474743c43a0126b88eb /game/network/routeWalker.h | |
parent | Only attempt to render renderable networks (diff) | |
download | ilt-56782dbb368117faaddda0a45ca2ecb753af90d7.tar.bz2 ilt-56782dbb368117faaddda0a45ca2ecb753af90d7.tar.xz ilt-56782dbb368117faaddda0a45ca2ecb753af90d7.zip |
Initial commit of the route finder
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 |