Example #1
0
        public void ProcessMatches(string matchlinks, string maplinks, string apiKey)
        {
            PopulateMatchIDs(matchlinks);
            CreatePool(maplinks);
            APIAccessor.ApiKey = apiKey;

            foreach (string matchID in MatchIDs)
            {
                OMP.Model.Match match = new OMP.Model.Match(matchID);
                matches.Add(match);
                JArray matchJSON = APIAccessor.RetrieveMatchDataAsync(matchID).Result;
                match.FillMaps(matchJSON);
            }

            foreach (OMP.Model.Match match in matches)
            {
                foreach (MatchMap map in match.Maps)
                {
                    if (mappool.MapIDs.Contains(map.mapID))
                    {
                        CalculateAllPlayerRatings(map);
                    }
                }
            }

            foreach (MatchPlayer player in players)
            {
                player.CalculateNewElo();
            }

            UpdateElo(players);
        }
Example #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            APIAccessor.ApiKey = apikeybox.Text;
            Match  match     = new Match(blueteambox.Text, redteambox.Text, matchidbox.Text);
            JArray matchJSON = APIAccessor.RetrieveMatchDataAsync(matchidbox.Text).Result;

            match.FillMaps(matchJSON);
            string       tablepath = "./" + matchidbox.Text + ".txt";
            StreamWriter file      = new StreamWriter(@tablepath);

            file.Write(CorsaceOpen2018ThreadCreator.CreateThreadText(match));
            file.Close();
        }