public double Euclidian(Node node) { var dx = node.X - End.X; var dy = node.Y - End.Y; return Math.Round( Math.Sqrt(dx * dx + dy * dy) * StraightCost,1); }
public void SetStart(int x, int y) { Start = new Node(x, y); }
public void SetEnd(int x, int y) { End = new Node(x, y); }
public Grid(int cols,int rows) { X = cols; Y = rows; Maze = new Node[Y][]; for (int i = 0; i < Y; i++) { Maze[i] = new Node[X]; for (int j = 0; j < X; j++) { Maze[i][j] = new Node(j, i); } } }
private bool IsOpen(Node test) { return Open.Contains(test); }
private bool IsCloed(Node test) { return Closed.Contains(test); }