示例#1
0
 public double DistanceToSqrt(Position position)
 {
     int a = position.X - X;
     int b = position.Y - Y;
     return Math.Sqrt(a * a + b * b);
 }
示例#2
0
 public int DistanceTo(Position position)
 {
     return Math.Max(Math.Abs(position.X - X), Math.Abs(position.Y - Y));
 }