private void clearOut() { tourneyMatchUp0.Visible = false; tourneyMatchUp1.Visible = false; tourneyMatchUp2.Visible = false; tourneyMatchUp3.Visible = false; tourneyMatchUp4.Visible = false; tourneyMatchUp5.Visible = false; tourneyMatchUp6.Visible = false; tourneyMatchUp7.Visible = false; tourneyMatchUp0.Parent = playTab; tourneyMatchUp1.Parent = playTab; tourneyMatchUp2.Parent = playTab; tourneyMatchUp3.Parent = playTab; tourneyMatchUp4.Parent = playTab; tourneyMatchUp5.Parent = playTab; tourneyMatchUp6.Parent = playTab; tourneyMatchUp7.Parent = playTab; tourneyMatchUp0 = new TourneyMatchUp(); tourneyMatchUp1 = new TourneyMatchUp(); tourneyMatchUp2 = new TourneyMatchUp(); tourneyMatchUp3 = new TourneyMatchUp(); tourneyMatchUp4 = new TourneyMatchUp(); tourneyMatchUp5 = new TourneyMatchUp(); tourneyMatchUp6 = new TourneyMatchUp(); tourneyMatchUp7 = new TourneyMatchUp(); }
private void clearTheMatchUp(TourneyMatchUp matchup) { matchup.clear(); matchup.reset(null, null); matchup.Visible = false; if (matchup.NextMatch != null) { clearTheMatchUp(matchup.NextMatch); } }
/// <summary> /// Will loop through each match-up, if the match up is a bye round, /// it will ensure that the concurrent match is set /// </summary> public void checkTourneyForByeRound() { for (int i = 0; i < allMatchups.Length; i++) { if (allMatchups[i].State == MatchState.ByeRound) { TourneyMatchUp nextMatch = allMatchups[i].NextMatch; if (nextMatch.RedTeam != allMatchups[i].Winner || nextMatch.BlueTeam != allMatchups[i].Winner) { nextMatch.addTeamToMatchUp(allMatchups[i].Winner); } } } }
private void returnToSetupButton_Click(object sender, EventArgs e) { for (int i = 0; i < allMatchups.Length; i++) { allMatchups[i].Dispose(); allMatchups[i] = new TourneyMatchUp(); allMatchups[i].Visible = false; } for (int i = 0; i < allMatchups.Length; i++) { allMatchups[i].clear(); } drawTournamentStart(preliminaries); tabControl.TabPages.Remove(playPage); tabControl.TabPages.Add(setupPage); tabControl.SelectedTab = tabControl.TabPages[0]; }
/// <summary> Private constructor helper to setup all components /// </summary> private void setupAll(Team red, Team blue) { RedTeam = red; BlueTeam = blue; Winner = null; recentlyModified = true; NextMatch = null; PreviousTopMatch = null; PreviousBottomMatch = null; back = new Button(); //sets the state of the control setState(); //Instantiates controls contained within this panel instantiateControls(); //Sets Design information about Panel constructTourneyMatchUp(); //default to hide the panel until ready Visible = false; }
public void showTournamentPlay() { //Get Seed setting from combo box string seedSetting = (string)seedSettingComboBox.SelectedItem; //Sort the teams according to seeding rule switch (seedSetting) { case "Manual": case "Input Order": //Both of these we dont need to apply an algorthim because //all work has been done manually (or not at all ) break; case "Rating": sortByRating(myParent.Data.InTourney); break; case "Random": sortRandomly(myParent.Data.InTourney); break; } //second thing we need to do is create matchups and save to manager Team[] teams = myParent.Data.InTourney; //first clear out any old matchups preliminaries = new TourneyMatchUp[numBrackets / 2]; int pos = 0; for (int i = 0; i < teams.Length; i += 2) { Team t1 = teams[i]; Team t2 = teams[i + 1]; preliminaries[pos++] = new TourneyMatchUp(t1, t2); } drawTournamentStart(preliminaries); //This works 7/24/10 }