Пример #1
0
 double distance(BoardObject a, BoardObject b)
 {
     return Math.Sqrt((b.X - a.X).Sqrd() + (b.Y - a.Y).Sqrd());
 }
Пример #2
0
 void FindTargetsAndShooters(BoardObject b)
 {
     ///Find targets in range
     if (b.Attributes == null) return;
     int range = b.Attributes["Range"];
     foreach (var a in DataModel.Instance.BoardObjects) {
         if (a.Attributes == null) continue;
         if (distance(a, b) < range) {
             a.TargetsInRange.Add(new Point(a.X, a.Y));
         }
     }
 }
Пример #3
0
 public static void AddBoardObject(BoardObject obj)
 {
     Instance.BoardObjects.Add(obj);
 }