private void OnGotCatalog(GetStoreItemsResult result)
    {
        GetStoreItemsCommandArgs localArgs = _args as GetStoreItemsCommandArgs;

        foreach (PlayFab.ClientModels.StoreItem storeItem in result.Store)
        {
            localArgs
            .DataStore
            .SetItem(storeItem.ItemId, new StoreItem
            {
                ID = storeItem.ItemId,
                VirtualCurrencyPrices = storeItem.VirtualCurrencyPrices
            });
        }
        GetStoreItemsCommandResult getStoreItemsResult = new GetStoreItemsCommandResult
        {
            // empty
        };

        Callback?.Invoke(getStoreItemsResult);
    }
示例#2
0
    public void GetStoreItems(WebRequestData args, Action <CommandResult> Callback)
    {
        if (args is GetStoreItemsRequestData localArgs)
        {
            CommandArgs commandArgs = new GetStoreItemsCommandArgs
            {
                Callback       = Callback,
                CatalogVersion = localArgs.CatalogVersion,
                StoreId        = localArgs.StoreId,
                DataStore      = localArgs.DataStore
            };

            GetStoreItemsCommand command = CommandFactory
                                           .Instance
                                           .CreateCommand <GetStoreItemsCommand>(commandArgs);
            command.Execute();
        }
        else
        {
            // Make more verbose exceptions
            throw new ArgumentException("Incorrect args data type;");
        }
    }