Exemple #1
0
        public KDA GetKDA(long accountId, int heroId)
        {
            var kda     = new KDA();
            var count   = 0;
            var players = GetMatchesByAccountAndHero(accountId, heroId).Select(m => m.Players.Find(p => p.AccountId == accountId));

            foreach (var player in players)
            {
                kda.Kills   += player.Kills;
                kda.Deaths  += player.Deaths;
                kda.Assists += player.Assists;
                count       += 1;
            }

            if (kda.Kills > 0)
            {
                kda.Kills = kda.Kills / count;
            }
            if (kda.Deaths > 0)
            {
                kda.Deaths = kda.Deaths / count;
            }
            if (kda.Assists > 0)
            {
                kda.Assists = kda.Assists / count;
            }

            return(kda);
        }
Exemple #2
0
        public virtual List <string> GetData()
        {
            List <string> list = new List <string>();

            list.Add(convertBool(FirstBlood).ToString(CultureInfo.InvariantCulture));
            list.Add(convertBool(FirstTurret).ToString(CultureInfo.InvariantCulture));
            list.Add(KP.ToString(CultureInfo.InvariantCulture));
            list.Add(KDA.ToString(CultureInfo.InvariantCulture));
            return(list);
        }
Exemple #3
0
 public string KDAToString(KDA kda)
 {
     return (kda.Kills / kda.Games) + "/" + (kda.Deaths / kda.Games) + "/" + (kda.Assists / kda.Games);
 }
Exemple #4
0
 public string KDAToString(KDA kda)
 {
     return((kda.Kills / kda.Games) + "/" + (kda.Deaths / kda.Games) + "/" + (kda.Assists / kda.Games));
 }