示例#1
0
 internal Dictionary<string, MatchupData[]> GetData(MatchOnly[] matches, Dictionary<long, int> matchesChamp)
 {
     champNames = requester.GetChampIds();
     this.matches = matches;
     this.matchesChamp = matchesChamp;
     GetSelfResults();
     GetRawResults();
     return GetMatchupData();
 }
示例#2
0
 internal void Compile(MatchOnly[] matches, Dictionary<long, int> matchesChamp, Dictionary<int, string> champDict)
 {
     foreach (MatchOnly match in matches)
     {
         int champ = matchesChamp[match.matchId];
         IEnumerable<Participant> participants = match.participants.Where(x => x.championId == champ);
         Participant self = participants.First();
         IEnumerable<Participant> teammates = match.participants.Where(x => x.teamId == self.teamId);
         IEnumerable<int> kills = teammates.Select(x => x.stats.kills);
         int teamKills = kills.Sum();
         IEnumerable<int> deaths = teammates.Select(x => x.stats.deaths);
         int teamDeaths = deaths.Sum();
         double score = Score(self.stats.kills + self.stats.assists, self.stats.deaths, teamKills, teamDeaths);
         string champName = champDict[champ];
         MatchStats matchStats = new MatchStats(Constants.MATCH_DETAILS + match.matchId, champName, self.stats.kills, self.stats.deaths, self.stats.assists);
         MatchScore matchScore = new MatchScore(match.matchId, score, self.stats.winner, matchStats);
         matchScores.Add(matchScore);
     }
 }
示例#3
0
 internal ChampData[] GetData(MatchOnly[] matches, Dictionary<long, int> matchesChamp)
 {
     this.matches = matches;
     this.matchesChamp = matchesChamp;
     GetSelfResults();
     GetGlobalResults();
     TallyResults();
     return GetChampData();
 }
示例#4
0
 private void WriteMatches(MatchOnly[] matches)
 {
     using (TextWriter textWriter = new StreamWriter(regionMatchesPath, true))
     {
         foreach (MatchOnly matchOnly in matches)
         {
             textWriter.WriteLine(JsonConvert.SerializeObject(matchOnly));
         }
     }
 }