Esempio n. 1
0
 static void RestoreTournament(bool redirection = false)
 {
     if (redirection == false)
     {
         tb = new TournamentBoss();
     }
 }
Esempio n. 2
0
        static void newTournament()
        {
            tb = new TournamentBoss();
            bool newT = tb.GenerateTemplateInputFile();

            if (newT == false)
            {
                RestoreTournament(true);
            }
            Console.WriteLine("Do you need to download the EGF Rating List? (yes / no)");
            if (Console.ReadLine().ToUpper().StartsWith("Y"))
            {
                tb.DownloadAllWorld();
            }
            // ZipFile.ExtractToDirectory("allworld_lp.zip","Data");

            tb.GeneratePlayers();
            tb.ReadPlayers(true, true);
            tb.SortField(true);
            Console.Clear();
            Console.WriteLine("Now please complete your data in the Settings File.");
            awaitText("When you have finished type 'done'", true, "done");
            tb.ReadSettings();
            tb.previewTopBar(true);
            tb.previewFloor(true);
            int rounds = tb.nRounds;

            //now we can start the tournament
            for (int i = startRound; i < rounds + 1; i++)
            {
                tb.MakeDraw(i);
                tb.ReadResults(i);
                tb.ProcessResults(i);
                tb.UpdateTiebreaks(i);
                tb.SortField();
                tb.GenerateStandingsfile(i);
            }
            tb.GenerateFinalStandingsFile(rounds);  //Experimental ! ?
            tb.GenerateEGFExport();
            tb.ConvertStandingsToHTML(rounds);

            Console.Clear();
            Console.WriteLine("The tournament has ended.");
            Console.WriteLine("We hope you enjoyed using Miasma to make the pairings.");
        }