Exemple #1
0
 public Builder add(ItemType type, int qty) {
   qty = qty < 0 ? 1 : qty;
   inventory.add(
       new Pair<>(type, qty <= type.getMaxStackQuantity() ? qty : type.getMaxStackQuantity()));
   return this;
 }
Exemple #2
0
 public Builder add(ItemType type) {
   inventory.add(new Pair<>(type, type.getMaxStackQuantity()));
   return this;
 }