public InventoryData CreateInventoryData() { InventoryData beginnerData = new InventoryData(); List <InventoryData.InventoryItemDataT> inventoryItemsData = beginnerData.inventoryItemsData; inventoryItemsData.Add(new InventoryData.InventoryItemDataT { amountAvailable = 5, typeEnum = InventoryItemsEnum.SimpleWarrior }); inventoryItemsData.Add(new InventoryData.InventoryItemDataT { amountAvailable = 5, typeEnum = InventoryItemsEnum.BowWarrior }); return(beginnerData); }
public void SaveInventoryData(InventoryData data) { string dataAsString = JsonConvert.SerializeObject(data); File.WriteAllText(dataFileName, dataAsString); }