private static void BinAdder(int binSize, int x) { Bin bin = new Bin(binSize); BinItem binItem = new BinItem(); binItem.Size = x; bin.addItem(binItem); binBox.Add(bin); }
public void addItem(BinItem item) { if (availableCapacity() > item.Size) { contents.Add(item); } else { throw new OverflowException("Bin capacity exceeded"); } }