public bool IsValid() { if (Logging != null) { switch (Logging) { case "compact": case "verbose": break; default: return(false); } } switch (Command) { case "download": return(DownloadOption.IsValid(this)); case "seed": return(SeedOption.IsValid(this)); } return(false); }
public Bracket(SeedOption seedOption, int bracketLevel, int bracketSequence) : base(seedOption) { ChildBracket2 = null; _competitor2 = null; Level = bracketLevel; ParentBracket = null; Sequence = bracketSequence; }
/// <summary> /// Public constructor used to create a new Tournament. /// </summary> /// <param name="competitors"></param> /// <param name="seedOption"></param> public Tournament(List<Competitor> competitors, SeedOption seedOption) { //Initialize internal members. _brackets = new List<Bracket>(); _winner = null; //Store the constructor param data. Competitors = competitors; SeedOption = seedOption; //Create the bracket structure for the tournament. CreateBrackets(); //Assign competitors to brackets AssignBrackets(); //Add code here to automatically advance competitors with a bye for the staring level AdvanceByeCompetitors(); }
/// <summary> /// Public constructor used to create a new Tournament. /// </summary> /// <param name="competitors"></param> /// <param name="seedOption"></param> public Tournament(List <Competitor> competitors, SeedOption seedOption) { //Initialize internal members. _brackets = new List <Bracket>(); _winner = null; //Store the constructor param data. Competitors = competitors; SeedOption = seedOption; //Create the bracket structure for the tournament. CreateBrackets(); //Assign competitors to brackets AssignBrackets(); //Add code here to automatically advance competitors with a bye for the staring level AdvanceByeCompetitors(); }
private void bStart_Click(object sender, EventArgs e) { try { try { this.Cursor = Cursors.WaitCursor; //Determine the seed we're to use SeedOption seedOption = GetSelectedSeed(); //Create competitor collection based on what's entered into the form List <Competitor> competitors = GetCompetitors(); //Create the tournament _tournament = new Tournament(competitors, seedOption); //Disable controls now that the tournament has been created SetEditControlUsability(false); //If the tournament was seeded randomly, repopulate our competitor grid LoadCompetitorGridFromTournament(); //Draw/create tournament brackets to display on screen this.Cursor = Cursors.WaitCursor; DrawTournamentBrackets(); } finally { this.Cursor = Cursors.Default; } } catch (Exception ex) { Ui.DisplayError(ex.Message); } }
public TournamentStage(SeedOption seedOption) { _competitor = null; ChildBracket = null; SeedOption = seedOption; }
public Winner(SeedOption seedOption) : base(seedOption) { }
/// <summary> /// Hides/shows the competitor grid's Seed column based on the selected seed option. /// </summary> /// <param name="seedOption"></param> private void SetSeedColumnVisibility(SeedOption seedOption) { colSeed.Visible = (seedOption == SeedOption.Seeded); }