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); }
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); }
public string KDAToString(KDA kda) { return (kda.Kills / kda.Games) + "/" + (kda.Deaths / kda.Games) + "/" + (kda.Assists / kda.Games); }
public string KDAToString(KDA kda) { return((kda.Kills / kda.Games) + "/" + (kda.Deaths / kda.Games) + "/" + (kda.Assists / kda.Games)); }