public override void Add(PBEItem item, ushort quantity = 1) { if (quantity == 0) { throw new ArgumentOutOfRangeException(nameof(quantity), "Quantity must be at least one."); } ItemPouchType pt = ItemData.GetPouchType(item); InventoryPouch <InventorySlotNew> pouch = this[pt]; InventorySlotNew slot = pouch[item]; if (slot == null) { pouch.Add(new InventorySlotNew(item, quantity)); } else { slot.Add(quantity); } }
public InventoryPouch(ItemPouchType type) { PouchType = type; _items = new List <T>(); }
public bool TryGetValue(ItemPouchType key, out InventoryPouch <T> value) { return(_pouches.TryGetValue(key, out value)); }
public bool ContainsKey(ItemPouchType key) { return(_pouches.ContainsKey(key)); }
public bool TryGetPouch(ItemType item, out InventoryPouch <T> pouch) { ItemPouchType pt = ItemData.GetPouchType(item); return(_pouches.TryGetValue(pt, out pouch)); }
public InventoryPouch <T> this[ItemPouchType pt] => _pouches[pt];