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()); } }
private void AttemptDirectPath() { while ((!PathComplete()) && (!current.Impassable())) { List <Node> options = current.GetAdjacentNodes(); if (options.Count == 0) { break; } AddToOpenSet(options); OpenNode(selectDirectNode(options)); } }