Example #1
0
        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();
        }
Example #2
0
        void TryLoadInventory(IPlayer player)
        {
            this.Inventory.DiscardAll();
            simpleinventory loadedinv = ApiExtensions.LoadOrCreateDataFile <simpleinventory>(Api, "helloworld.json");

            if (loadedinv == null)
            {
                return;
            }

            this.MarkDirty();
        }