Example #1
0
        private async Task <TacticInfo> GetInfoAsync(string id)
        {
            string token = await getToken;

            var payload  = new { token, blunder_id = id };
            var response = await client.PostAsync("blunder/info", GetPayloadContent(payload));

            var responseString = await response.Content.ReadAsStringAsync();

            TacticResponse <TacticInfo> tacticsResponse = JsonConvert.DeserializeObject <TacticResponse <TacticInfo> >(responseString);

            return(tacticsResponse.data);
        }
Example #2
0
        public async Task <Tactic> GetAsync()
        {
            string token = await getToken;

            var payload  = new { token, type = "explore" };
            var response = await client.PostAsync("blunder/get", GetPayloadContent(payload));

            var responseString = await response.Content.ReadAsStringAsync();

            TacticResponse <Tactic> tacticsResponse = JsonConvert.DeserializeObject <TacticResponse <Tactic> >(responseString);

            currentTactic = tacticsResponse.data;

            currentTactic.Info = await GetInfoAsync(currentTactic.id);

            return(currentTactic);
        }