summaryrefslogtreecommitdiff
path: root/game/network/routeWalker.h
blob: ebdf66e1843adbaa2d104a08457eb25d70a35574 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#pragma once

#include "link.h"
#include <set>

class RouteWalker {
public:
	using Solution = Link::Nexts;

	RouteWalker();

	Solution findRouteTo(const Link::End & currentEnd, const Node::Ptr & dest);

private:
	void findRouteTo(const Link::End & currentEnd, const Node::Ptr & dest, float length);

	std::set<const Link::End *> visited;
	Solution bestSolution, currentSolution;
	float solutionLength;
};