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