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); }
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); }