private void SetStats(EogStatsBlock eog) { var players = eog.Teams.SelectMany(s => s.Players).ToList(); Players = players.Select(s => { var model = new EndGamePlayerStats { Assists = s.Stats.Assists, ChampionId = s.ChampionId, Team = s.TeamId, TotalDamageToChampions = s.Stats.TotalDamageDealtToChampions, Leaves = s.Leaves, Wins = s.Wins, Losses = s.Losses, Level = s.Level, SummonerName = s.SummonerName, SummonerId = s.SummonerId, Deaths = s.Stats.NumDeaths, Kills = s.Stats.ChampionsKilled }; if (eog.SummonerId != s.SummonerId && !s.BotPlayer) { var findHistory = DataBaseService.GetSummoner(s.SummonerId); model.GamesPlayedWithHim = findHistory == null ? 0 : findHistory.GamesPlayedWithHim; DataBaseService.IncreaseSummonerGwh(s.SummonerId); } return(model); }).OrderByDescending(o => o.TotalDamageToChampions).ToList(); SelectedPlayer = Players.First(f => f.SummonerName == eog.SummonerName); }
public void NoteEdit(EndGamePlayerStats player) { DataBaseService.SetSummonerNote(player.SummonerId, player.Note.WithMaxLength(50)); }