/// <summary> /// Add an item to the given equip location. Do not attempt to equip to /// an incompatible slot. /// </summary> public void AddItem(EquipLocation slot, EquipableItem item) { Debug.Assert(item.GetAllowedEquipLocation() == slot); equippedItems[slot] = item; if (equipmentUpdated != null) { equipmentUpdated(); } }
/// <summary> /// Attempts to add item to the request equipment slot /// </summary> /// <param name="item"></param> /// <param name="location"></param> public void AddItem(EquipableItem item, EquipLocation location) { //Check if the item can go into the requested slot Debug.Assert(item.GetAllowedEquipLocation() == location); //Equip the item m_EquippedItems[location] = item; if (equipmentUpdated != null) { equipmentUpdated(); } }