Esempio n. 1
0
        public async Task <Tactic> LoadTacticAsync()
        {
            currentTactic = await tacticsService.GetAsync();

            SetState(TacticState.InProgress);
            LoadFrom(currentTactic.fenBefore);

            return(currentTactic);
        }
Esempio n. 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);
        }