Exemple #1
0
        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);
        }
Exemple #2
0
 public void SetStart(int x, int y)
 {
     Start = new Node(x, y);
 }
Exemple #3
0
 public void SetEnd(int x, int y)
 {
     End = new Node(x, y);
 }
Exemple #4
0
 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);
         }
     }
 }
Exemple #5
0
 private bool IsOpen(Node test)
 {
     return Open.Contains(test);
 }
Exemple #6
0
 private bool IsCloed(Node test)
 {
     return Closed.Contains(test);
 }