Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 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;
     }
 }