public void OccypyArea(ISquareable obstacle)
 {
     if(this.IsOccupyAvaliable(obstacle))
         _occupiedArea += obstacle.GetArea();
     else
         throw new ArgumentException("Not enough free space for this object");
 }
Beispiel #2
0
 public static bool IsOccupyAvaliable(this ITerritory squareTerritory, ISquareable other)
 {
     return squareTerritory.GetFreeArea().CompareTo(other.GetArea()) >= 0;
 }