public static Request DownloadItemTemplatesRequest(Client client)
        {
            var downloadItemTemplatesMessage = new DownloadItemTemplatesMessage
            {
                PageOffset = client.PageOffset
            };

            return(new Request
            {
                RequestType = RequestType.DownloadItemTemplates,
                RequestMessage = downloadItemTemplatesMessage.ToByteString()
            });
        }
Exemple #2
0
        public static Request DownloadItemTemplatesRequest(Client client)
        {
            var downloadItemTemplatesMessage = new DownloadItemTemplatesMessage
            {
                // To be implemented
                //Paginate =
                PageOffset = client.PageOffset
                             //page_timestamp =
            };

            return(new Request
            {
                RequestType = RequestType.DownloadItemTemplates,
                RequestMessage = downloadItemTemplatesMessage.ToByteString()
            });
        }
Exemple #3
0
        public async Task <DownloadItemTemplatesResponse> GetItemTemplates()
        {
            IMessage downloadItemTemplatesMessage = new DownloadItemTemplatesMessage();
            var      downloadItemTemplatesRequest = new Request
            {
                RequestType    = RequestType.DownloadItemTemplates,
                RequestMessage = downloadItemTemplatesMessage.ToByteString()
            };

            var requestEnvelope = await GetRequestBuilder().GetRequestEnvelope(CommonRequest.FillRequest(downloadItemTemplatesRequest, Client)).ConfigureAwait(false);

            Tuple <DownloadItemTemplatesResponse, CheckChallengeResponse, GetHatchedEggsResponse, GetInventoryResponse, CheckAwardedBadgesResponse, DownloadSettingsResponse> response =
                await
                PostProtoPayload
                <Request, DownloadItemTemplatesResponse, CheckChallengeResponse, GetHatchedEggsResponse, GetInventoryResponse,
                 CheckAwardedBadgesResponse, DownloadSettingsResponse>(requestEnvelope).ConfigureAwait(false);

            DownloadItemTemplatesResponse downloadItemTemplatesResponse = response.Item1;

            ItemTemplates = downloadItemTemplatesResponse.ItemTemplates;
            PokemonMeta.Update(downloadItemTemplatesResponse);

            CheckChallengeResponse checkChallengeResponse = response.Item2;

            CommonRequest.ProcessCheckChallengeResponse(Client, checkChallengeResponse);

            GetInventoryResponse getInventoryResponse = response.Item4;

            CommonRequest.ProcessGetInventoryResponse(Client, getInventoryResponse);

            DownloadSettingsResponse downloadSettingsResponse = response.Item6;

            CommonRequest.ProcessDownloadSettingsResponse(Client, downloadSettingsResponse);

            return(response.Item1);
        }