コード例 #1
0
        public Dictionary <string, dynamic> GetStatistic(string playerName)
        {
            var matches       = database.GetMatchesWithPlayer(playerName);
            var lastMatchData = database.GetLastMatchDateTime();

            var statistic = new Dictionary <string, dynamic>
            {
                { "totalMatchesPlayed", GetTotalMatchesPlayed(matches) },
                { "totalMatchesWon", GetTotalMatchesWon(matches, playerName) },
                { "favoriteServer", GetFavoriteServer(matches) },
                { "uniqueServers", GetUniqueServersCount(matches) },
                { "favoriteGameMode", GetFavoriteGameMode(matches) },
                { "averageScoreboardPercent", GetAverageScoreboardPercent(matches, playerName) },
                { "maximumMatchesPerDay", GetMaximumMatchesPerDay(matches) },
                { "averageMatchesPerDay", GetAverageMatchesPerDay(matches, lastMatchData) },
                { "lastMatchPlayed", GetLastMatchDateTime(matches).ToUtcString() },
                { "killToDeathRatio", GetKillToDeathRatio(matches, playerName) }
            };

            return(statistic);
        }