Esempio n. 1
0
 public PlayerStats(string summonerName, ParticipantStats stats, TimeSpan matchDuration)
 {
     _matchDuration = matchDuration;
     _won           = stats.Winner;
     SummonerName   = summonerName;
     Kda            = new Kda(stats);
 }
Esempio n. 2
0
        private decimal CalculatePenalty(Kda kda, TimeSpan matchDuration,
                                         bool won)
        {
            var basePenality = kda.Deaths / (kda.Kills + kda.Assists + 1.0) *
                               matchDuration.TotalMinutes * 0.05;

            if (won)
            {
                return(RoundTo2Digits(basePenality));
            }

            return(RoundTo2Digits(1.5 * basePenality));
        }