Ejemplo n.º 1
0
 private void OpenNode(Node node)
 {
     current = node;
     openSet.Remove(node);
     closedSet.Add(node);
     if (!node.Impassable() || node == start) // don't add new open set nodes for blocked paths.
     {
         AddToOpenSet(node.GetAdjacentNodes());
     }
 }
Ejemplo n.º 2
0
 private void AttemptDirectPath()
 {
     while ((!PathComplete()) && (!current.Impassable()))
     {
         List <Node> options = current.GetAdjacentNodes();
         if (options.Count == 0)
         {
             break;
         }
         AddToOpenSet(options);
         OpenNode(selectDirectNode(options));
     }
 }