public void AddItem(Decoration decoration) { if (AvailableCapacity < decoration.Size) { throw new NotEnoughCapacityException(); } AvailableCapacity -= decoration.Size; Items.Append(decoration); }
public void RemoveItem(int decorationId) { Decoration decoration = Items.FirstOrDefault(i => i.Id == decorationId); if (decoration != null) { Items.ToList().Remove(decoration); AvailableCapacity += decoration.Size; } }