Ejemplo n.º 1
0
        private DamageDealt ComputeDamageDealtByTeam(List <ParticipantDto> participants, int teamId, int playerParticipantId)
        {
            DamageDealt dmgDealt = new DamageDealt();

            participants.ForEach(delegate(ParticipantDto participant)
            {
                if (participant.teamId == teamId && participant.participantId != playerParticipantId)
                {
                    dmgDealt.Add(participant.stats.totalDamageDealtToChampions, participant.stats.damageDealtToTurrets);
                }
            });

            return(dmgDealt);
        }
Ejemplo n.º 2
0
        public DamageDealt ComputeDamageDealtByPlayer(List <ParticipantDto> participants, int participantId)
        {
            DamageDealt dmg = new DamageDealt();

            participants.ForEach(delegate(ParticipantDto participant)
            {
                if (participant.participantId == participantId)
                {
                    dmg.Add(participant.stats.totalDamageDealtToChampions, participant.stats.damageDealtToTurrets);
                }
            });

            return(dmg);
        }
Ejemplo n.º 3
0
        public DamageDealt ComputeAverageDamageDealtByPlayer(List <MatchDto> matches, long accountId)
        {
            DamageDealt dmgDealtByPlayer = new DamageDealt();
            int         totalGames       = matches.Count;

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

                dmgDealtByPlayer.Add(ComputeDamageDealtByPlayer(match.participants, playerParticipantId));
            });

            dmgDealtByPlayer.Normalize(matches.Count);

            return(dmgDealtByPlayer);
        }
Ejemplo n.º 4
0
        public DamageDealt ComputeDamageDealtByTeam(List <MatchDto> matches, long accountId, Boolean isPlayerTeam)
        {
            DamageDealt dmgDealtByTeam = new DamageDealt();

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

                int playerTeamId = Retrieve.PlayerTeamId(match.participants, playerParticipantId);

                dmgDealtByTeam.Add(ComputeDamageDealtByTeam(match.participants, playerTeamId, playerParticipantId));
            });

            dmgDealtByTeam.Normalize(matches.Count * (isPlayerTeam ? 4 : 5));

            return(dmgDealtByTeam);
        }