コード例 #1
0
 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);
 }
コード例 #2
0
 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);
 }
コード例 #3
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);
 }
コード例 #4
0
 public Inventory.InventoryInfo Replace(int slot, Inventory.InventoryInfo info)
 {
     return(inventory.Replace(slot, info));
 }