public List <Node> setPath(Node target, PathGraph navMap) { Node closest = getClosestNode(getAdjacentNodes(navMap.nodes)); List <Node> tempShortest = navMap.getShortestPath(closest, target); shortestPath = new Stack <Node>(); foreach (Node n in tempShortest) { shortestPath.Push(n); } return(tempShortest); }
public void updateViewPathMode(Node n) { if (startNode == null) { startNode = n; } else if (targetNode == null) { targetNode = n; shortestPath = navMap.getShortestPath(startNode, targetNode); } else { startNode = n; targetNode = null; shortestPath = null; } }