Пример #1
0
 public void AddResult(PlayerResultModel result)
 {
     _winsList.Add(result);
     _winsList.Sort();
     if (_winsList.Count > maxLength)
     {
         _winsList.Remove(_winsList[maxLength]);
     }
 }
Пример #2
0
        //public IEnumerable<PlayerResultModel> GetListResults()
        //{
        //    return _winsList;
        //}

        public LeaderboardDto GetLeaderboardDto()
        {
            var results = new PlayerResultModel[maxLength];

            for (int i = 0; i < _winsList.Count; i++)
            {
                results[i] = _winsList[i];
            }
            return(new LeaderboardDto(results));
        }