public Inventory(InventoryGlob inventorySaveGlob) : base(SIZE) { TotalCost = 0; SetupItem setupItem; for (int i = 0; i < SIZE; ++i) { SetupItemsDictionary.TryGetItem(inventorySaveGlob.itemSlots[i].itemID, out setupItem); data[i] = new ItemSlot(setupItem, inventorySaveGlob.itemSlots[i].quantity); TotalCost += (int)data[i].GetValue(); } }
public Equipment(EquipmentGlob equipmentSaveGlob) : base(SIZE) { TotalCost = 0; SetupItem setupItem; for (int i = 0; i < SIZE; ++i) { SetupItemsDictionary.TryGetItem(equipmentSaveGlob.itemSlots[i].itemID, out setupItem); setupItem.SetIsEquipped(true); data[i] = new ItemSlot(setupItem, equipmentSaveGlob.itemSlots[i].quantity); if (setupItem is AugmentedArmour || setupItem is AugmentedWeapon) { augmentedEquipmentIndexes.Add(i); } } }
public PrefightItems(PrefightItemsGlob prefightItemsGlob) : base(SIZE) { TotalCost = 0; bool emptyGlob = (prefightItemsGlob == null); SetupItem setupItem; for (int i = 0; i < SIZE; ++i) { if (emptyGlob) { data[i] = new ItemSlot(General.NullItem(), 1); } else { SetupItemsDictionary.TryGetItem(prefightItemsGlob.itemSlots[i].itemID, out setupItem); data[i] = new ItemSlot(setupItem, prefightItemsGlob.itemSlots[i].quantity); TotalCost += (int)data[i].GetValue(); } } }