public Inventory.InventoryInfo Replace(int slot, Inventory.InventoryInfo info) { Inventory.InventoryInfo result = inventory.Replace(slot, info); if (ProjectUtil.IsEquipmentSlot(slot)) { UpdateWeapons(slot - inventory.size); } return(result); }
public int GetCost(int index) { Inventory.InventoryInfo itemInfo = inventory.GetItem(index); if (itemInfo.occupied) { return(itemInfo.item.cost * itemInfo.quantity); } Debug.LogWarning("Getting cost of an empty item slot"); return(0); }
public static void SwapBetweenInventories(IInventoryManager firstManager, int firstIndex, IInventoryManager secondManager, int secondIndex) { Inventory.InventoryInfo tempFrom1 = firstManager.Remove(firstIndex); Inventory.InventoryInfo tempFrom2 = secondManager.Replace(secondIndex, tempFrom1); firstManager.Replace(firstIndex, tempFrom2); }
public Inventory.InventoryInfo Replace(int slot, Inventory.InventoryInfo info) { return(inventory.Replace(slot, info)); }