示例#1
0
        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);
        }
示例#2
0
 public void addItem(BinItem item)
 {
     if (availableCapacity() > item.Size)
     {
         contents.Add(item);
     }
     else
     {
         throw new OverflowException("Bin capacity exceeded");
     }
 }