Exemple #1
0
        public async Task <List <Match> > GetMatchesAsync(string playerId, int size)
        {
            List <Match> matches;

            try
            {
                matches = await apiService.FetchMatchesAsync(playerId, size);
            }
            catch { throw; }
            for (int i = 0; i < matches.Count - 1; ++i)
            {
                if (matches[i].ELO != 0)
                {
                    Match nextMatchWithElo = matches.FirstOrDefault(m => m.Index > i && m.ELO != 0);
                    matches[i].ChangeELO = nextMatchWithElo != null ? matches[i].ELO - nextMatchWithElo.ELO : 0;
                }
            }

            return(matches);
        }