AStar<TNode, TConnection>
A static class in Root.Township, the global namespace.
Generic A* path search over any node and connection types that implement the A* interfaces. Search state is stored on each node's WorkingNode, so don't run two searches over the same nodes at once.
- Listed in Global namespace: A to B
Methods
| Member | What it is |
|---|---|
static bool IsWithinNodes(TNode start, TNode end, int count, AStarTravelCondition<TNode, TConnection> travelCondition = null) | True if the end can be reached from the start within the given number of steps. |
static bool Pathfind(TNode start, AStarDestinationCondition<TNode, TConnection> condition, out List<TConnection> path, out TNode end, out float distance, AStarTravelCondition<TNode, TConnection> travelCondition = null, bool isTracingBack = true, int maxNodeCount = -1) | Finds the cheapest path to a target node, a set of possible ends (with heuristic), or any node passing a condition (no heuristic). Skips disabled connections. |
static bool Pathfind(TNode start, ICollection<TNode> possibleEnd, out List<TConnection> path, out TNode end, out float distance, AStarTravelCondition<TNode, TConnection> travelCondition = null, bool isTracingBack = true, int maxNodeCount = -1) | Finds the cheapest path to a target node, a set of possible ends (with heuristic), or any node passing a condition (no heuristic). Skips disabled connections. |
static List<TConnection> Pathfind(TNode start, TNode end, AStarTravelCondition<TNode, TConnection> travelCondition = null) | Finds the cheapest path to a target node, a set of possible ends (with heuristic), or any node passing a condition (no heuristic). Skips disabled connections. |