public void AddItem(EquipLocation slot, EquipableItem item) { //Add the item to a slot Debug.Assert(item.GetAllowedEquipLocation() == slot); _equippedItems[slot] = item; EquipmentUpdated?.Invoke(); }
public void Equip(EquipmentBlueprint Item) { int SlotIndex = (int)Item.EquipSlot; // get equipment currently in use EquipmentBlueprint oldEquipment; // Swap new equipment with old if (equipmentSlot[SlotIndex] != null) { oldEquipment = equipmentSlot[SlotIndex]; Inventory.InventoryInstance.AddToInventory(oldEquipment); } equipmentSlot[SlotIndex] = Item; // apply the trait values of the equipment to the player stat ApplyTraitsToPlayer(Item); if (CallEquipmentUpdated != null) { CallEquipmentUpdated.Invoke(Item, true); } }
public void WipeEquipment() { _equippedItems = new Dictionary <EquipLocation, EquipableItem>(); EquipmentUpdated?.Invoke(); }
public void RemoveItem(EquipLocation slot) { //Remove the item from this slot _equippedItems.Remove(slot); EquipmentUpdated?.Invoke(); }