public InventoryData(CharacterMaster master) { var inventory = master.inventory; infusionBonus = (int)inventory.infusionBonus; items = new List <ItemData>(); foreach (var item in inventory.itemAcquisitionOrder) { items.Add(new ItemData((int)item, inventory.GetItemCount(item))); } equipments = new EquipmentData[inventory.GetEquipmentSlotCount()]; for (var i = 0; i < equipments.Length; i++) { equipments[i] = new EquipmentData(inventory.GetEquipment((uint)i)); } activeEquipmentSlot = inventory.activeEquipmentSlot; }
public InventoryData(Inventory inventory) { infusionBonus = (int)inventory.infusionBonus; items = new List <ItemData>(); foreach (var item in inventory.itemAcquisitionOrder) { items.Add(new ItemData { itemIndex = (int)item, count = inventory.GetItemCount(item) }); } equipments = new EquipmentData[inventory.GetEquipmentSlotCount()]; for (var i = 0; i < equipments.Length; i++) { equipments[i] = new EquipmentData(inventory.GetEquipment((uint)i)); } activeEquipmentSlot = inventory.activeEquipmentSlot; }