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);
        }
Пример #2
0
        public void SaveInventoryData(InventoryData data)
        {
            string dataAsString = JsonConvert.SerializeObject(data);

            File.WriteAllText(dataFileName, dataAsString);
        }