예제 #1
0
 public void AddItem(Decoration decoration)
 {
     if (AvailableCapacity < decoration.Size)
     {
         throw new NotEnoughCapacityException();
     }
     AvailableCapacity -= decoration.Size;
     Items.Append(decoration);
 }
예제 #2
0
        public void RemoveItem(int decorationId)
        {
            Decoration decoration = Items.FirstOrDefault(i => i.Id == decorationId);

            if (decoration != null)
            {
                Items.ToList().Remove(decoration);
                AvailableCapacity += decoration.Size;
            }
        }