Ejemplo n.º 1
0
        public PlayerScores GetPlayerScoresForCurrentMatch(List <ParticipantDto> participants, int participantId)
        {
            PlayerScores playerScores = new PlayerScores();

            participants.ForEach(delegate(ParticipantDto participant)
            {
                if (participant.participantId == participantId)
                {
                    playerScores.AddScores(participant.stats.kills, participant.stats.deaths, participant.stats.assists);
                }
            });

            return(playerScores);
        }
Ejemplo n.º 2
0
        private PlayerScores ComputePlayerKDA(List <MatchDto> matches, long accountId)
        {
            PlayerScores playerScores = new PlayerScores();

            matches.ForEach(delegate(MatchDto match)
            {
                int participantId = Retrieve.ParticipantIdForCurrentMatch(match.participantsIdentities, accountId);

                playerScores.AddScores(GetPlayerScoresForCurrentMatch(match.participants, participantId));
            });

            playerScores.NormalizeScores(matches.Count);

            return(playerScores);
        }