private void OnUpdate(InventoryKey key) { if (key == this.key) { RaiseEvents(); } }
public void UpdateSlot(InventoryKey key, WeaponSlot slot) { if (_weapons.ContainsKey(key)) { _weapons[key] = slot; } else { _weapons.Add(key, slot); } OnInventoryChanged?.Invoke(key); }
public void UpdateSlot(InventoryKey key, AggregateSlot slot) { if (_aggregates.ContainsKey(key)) { _aggregates[key] = slot; } else { _aggregates.Add(key, slot); } OnInventoryChanged?.Invoke(key); }
public static WeaponItem CreateInstance( InventoryKey key, Sprite sprite, Weapon weapon, bool requiresApprovalToPickUp = false) { var instance = CreateInstance <WeaponItem>(); instance.Key = key; instance.Sprite = sprite; instance.RequiresApprovalToPickUp = requiresApprovalToPickUp; instance.Item = weapon; return(instance); }
public bool RetrieveSlot(InventoryKey key, out WeaponSlot slot) { return(_weapons.TryGetValue(key, out slot)); }
public bool RetrieveSlot(InventoryKey key, out AggregateSlot slot) { return(_aggregates.TryGetValue(key, out slot)); }
public void RemoveWeaponSlot(InventoryKey key) { _weapons.Remove(key); OnInventoryChanged?.Invoke(key); }
public void RemoveAggregateSlot(InventoryKey key) { _aggregates.Remove(key); OnInventoryChanged?.Invoke(key); }