예제 #1
0
        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();
        }
예제 #2
0
 private void clearTheMatchUp(TourneyMatchUp matchup)
 {
     matchup.clear();
     matchup.reset(null, null);
     matchup.Visible = false;
     if (matchup.NextMatch != null)
     {
         clearTheMatchUp(matchup.NextMatch);
     }
 }
예제 #3
0
 /// <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);
             }
         }
     }
 }
예제 #4
0
 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];
 }
예제 #5
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;
        }
예제 #6
0
        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
        }