private static async Task <UnRankedObject> ComputeStats(ModeStats stats) { if (stats != null) { return(new UnRankedObject() { GamesPlayed = (int)stats.RoundsPlayed, Wins = (int)stats.Wins, WinPercent = Math.Round(StatsCalculation.GetWinRatio(stats.Wins, stats.RoundsPlayed), 2), AvgSurvivalTime = Math.Round(StatsCalculation.GetAverageSurvivedTime(stats.TimeSurvived, stats.RoundsPlayed), 2), Adr = (int)StatsCalculation.GetAdr(stats.DamageDealt, stats.RoundsPlayed), HeadshotRatio = Math.Round(StatsCalculation.GetHeadshotRatio(stats.HeadshotKills, stats.Kills), 2), MaxKills = (int)stats.RoundMostKills, LongestKill = Math.Round(stats.LongestKill, 2), DbnosPerRound = Math.Round(StatsCalculation.GetKnocksPerRound(stats.DBNOS, stats.RoundsPlayed), 2), FraggerRating = Math.Round(StatsCalculation.GetFraggerRating( StatsCalculation.GetAdr(stats.DamageDealt, stats.RoundsPlayed), StatsCalculation.GetHeadshotRatioBelowOne(stats.HeadshotKills, stats.Kills), StatsCalculation.GetAverageSurvivedTimeBase10(stats.TimeSurvived, stats.RoundsPlayed), StatsCalculation.GetWinRatioBelowOne(stats.Wins, stats.RoundsPlayed)), 0) }); } else { return(new UnRankedObject() { GamesPlayed = 0, Wins = 0, WinPercent = 0, AvgSurvivalTime = 0, Adr = 0, HeadshotRatio = 0, MaxKills = 0, LongestKill = 0, DbnosPerRound = 0, FraggerRating = 0 }); } }
public DictionaryDataForMode(Mode k, ModeStats v) { key = k; value = v; }