public static void ResetMap(ref NavMap map) { if (map == null) return; foreach(PathNode node in map.Nodes.Values) { node.DistanceEstimated = 0; node.DistanceExact = 0; node.DistanceTotal = 0; node.backPointer = null; node.IsVisited = false; } }
public static PathNode FindPath(PathfindingAlgorithms algorithm, PathNode start, PathNode target, NavMap map) { if (start == null || target == null || map == null) return null; switch (algorithm) { case PathfindingAlgorithms.BreadthFirst: return PathfindingUtilities.ReversePath(BreadthFirst(ref start, ref target)); case PathfindingAlgorithms.Dijkstra: return PathfindingUtilities.ReversePath(Dijkstra(ref start, ref target)); case PathfindingAlgorithms.BestFirst: return PathfindingUtilities.ReversePath(BestFirst(ref start, ref target)); default: case PathfindingAlgorithms.aStar: return PathfindingUtilities.ReversePath(aStar(ref start, ref target)); } }
public City() : base() { this.NavMap = new NavMap(); }