public static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var p = new StandardTournamentsPluginEnumerator(); var factories = from f in p.EnumerateFactories() let pf = f as IPairingsGeneratorFactory where pf != null select pf; var chosen = (new PairingsChooserView(factories)).Run(); if (chosen != null) { IPairingsGenerator pg = chosen.Create(); if (pg == null) { MessageBox.Show("There was an error creating an instance of the '" + chosen.Name + "' pairings generator. :("); return; } (new TournamentView(pg)).Run(); } }
static void Main(string[] args) { var p = new StandardTournamentsPluginEnumerator(); var factories = from f in p.EnumerateFactories() let pf = f as IPairingsGeneratorFactory where pf != null select pf; generator = (EliminationTournament)factories.ToList()[0].Create(); teams.Add(new User(0, 100)); teams.Add(new User(1, 100)); generator.Reset(); generator.LoadState(teams, rounds); // add winner TournamentRound round = generator.CreateNextRound(null); round.Pairings[0].TeamScores[0].Score = new HighestPointsScore(200); round.Pairings[0].TeamScores[1].Score = new HighestPointsScore(100); rounds.Add(round); var standings = generator.GenerateRankings(); generator.Reset(); generator.LoadState(teams, rounds); round = generator.CreateNextRound(null); Console.Read(); }