Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.74 KB | None | 0 0
  1.         private void UpdateGoalCost()
  2.         {
  3.             //var nodes = 0;
  4.  
  5.             //int startX = Goal.X > Position.X ? Position.X : Goal.X;
  6.             //int startY = Goal.Y > Position.Y ? Position.Y : Goal.Y;
  7.  
  8.             //int endX = startX == Position.X ? Goal.X : Position.X;
  9.             //int endY = startY == Position.Y ? Goal.Y : Position.Y;
  10.  
  11.             //while (startX != endX)
  12.             //{
  13.             //    startX += Size.X;
  14.  
  15.             //    nodes++;
  16.             //}
  17.  
  18.             //while (startY != endY)
  19.             //{
  20.             //    startY += Size.Y;
  21.  
  22.             //    nodes++;
  23.             //}
  24.  
  25.             GoalCost = (Math.Abs(Goal.X - Position.X) + Math.Abs(Goal.Y - Position.Y)) * 10;
  26.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement