Ejemplo n.º 1
0
 public static void Main(string[] args)
 {
     var requester = new Requester(ApiKey, Region.NA);
     var matches = requester.GetMatches(Allen, false, true, false, false);
     Console.WriteLine("number of matches: {0}", matches.Count());
     Console.ReadLine();
 }
Ejemplo n.º 2
0
        private static void Main(string[] args)
        {
            XmlConfigurator.Configure();
            File.WriteAllText(NAMES_FILE, String.Empty);
            Requester requester = new Requester(Settings.Default.ApiKey, Settings.Default.Region);

            using (StreamReader streamReader = new StreamReader(CANDIDATES_FILE))
            {
                string candidatesStream = streamReader.ReadToEnd();
                IOrderedEnumerable<string> candidates = Formatter.Format(
                    Settings.Default.FirstCandidate,
                    Settings.Default.LastCandidate,
                    candidatesStream);
                string firstCandidate = candidates.First();
                string lastCandidate = candidates.Last();
                log.InfoFormat(
                    "first candidate: \"{0}\", last candidate: \"{1}\"",
                    Settings.Default.FirstCandidate == String.Empty ? firstCandidate : String.Empty,
                    Settings.Default.LastCandidate == String.Empty ? lastCandidate : String.Empty);
                StringBuilder strBuilder = new StringBuilder();
                int candidatesCount = candidates.Count();

                for (int i = 0; i < candidatesCount; i++)
                {
                    string candidate = candidates.ElementAt(i);
                    bool summonerExists = requester.CheckSummonerExists(candidate);

                    if (!summonerExists)
                    {
                        strBuilder.Append(String.Format("{0}{1}", candidate, Environment.NewLine));
                    }

                    bool candidatesLessThanCheckpoints = candidatesCount < Settings.Default.Checkpoints;

                    if (candidatesLessThanCheckpoints)
                    {
                        continue;
                    }

                    if (i % (candidatesCount / Settings.Default.Checkpoints) == 0)
                    {
                        log.InfoFormat(
                            "checkpoint: {0}/{1}, candidate: \"{2}\"",
                            Convert.ToInt32(i * Convert.ToDouble(Settings.Default.Checkpoints) / candidatesCount),
                            Settings.Default.Checkpoints,
                            candidate);
                        string names = strBuilder.ToString();
                        File.AppendAllText(NAMES_FILE, names);
                        strBuilder = new StringBuilder();
                    }
                }

                File.AppendAllText(NAMES_FILE, strBuilder.ToString());
            }

            Process.Start(NAMES_FILE);
        }
Ejemplo n.º 3
0
 internal DuoProgram(Requester requester)
 {
     this.requester = requester;
 }
Ejemplo n.º 4
0
 internal MatchupProgram(Requester requester)
 {
     this.requester = requester;
 }
Ejemplo n.º 5
0
 public FifthProgram(Requester requester)
 {
     this.requester = requester;
     champDict = requester.GetChampIds();
     Exists = true;
 }
Ejemplo n.º 6
0
 internal ChampProgram(Requester requester)
 {
     this.requester = requester;
 }