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);
            }
        }
Exemple #2
0
 public InventoryPouch(ItemPouchType type)
 {
     PouchType = type;
     _items    = new List <T>();
 }
Exemple #3
0
 public bool TryGetValue(ItemPouchType key, out InventoryPouch <T> value)
 {
     return(_pouches.TryGetValue(key, out value));
 }
Exemple #4
0
 public bool ContainsKey(ItemPouchType key)
 {
     return(_pouches.ContainsKey(key));
 }
Exemple #5
0
        public bool TryGetPouch(ItemType item, out InventoryPouch <T> pouch)
        {
            ItemPouchType pt = ItemData.GetPouchType(item);

            return(_pouches.TryGetValue(pt, out pouch));
        }
Exemple #6
0
 public InventoryPouch <T> this[ItemPouchType pt] => _pouches[pt];