void TrySaveInventory(IPlayer player) { simpleinventory items = new simpleinventory(); items.uid = player.PlayerUID; items.uname = player.PlayerName; items.StoreInventory(this.Inventory.ToList()); ApiExtensions.SaveDataFile <simpleinventory>(Api, "helloworld.json", items); this.Inventory.DiscardAll(); }
void TryLoadInventory(IPlayer player) { this.Inventory.DiscardAll(); simpleinventory loadedinv = ApiExtensions.LoadOrCreateDataFile <simpleinventory>(Api, "helloworld.json"); if (loadedinv == null) { return; } this.MarkDirty(); }