private void MainGrid_Loaded(object sender, RoutedEventArgs e)
        {
            worldCup = new WorldCup();
            worldCup.TeamProvider = new FootballLib.DataProviders.SqlProvider();
            PreRound   preRound   = new PreRound();
            PlayOff    playOff    = new PlayOff();
            OctRound   octRound   = new OctRound();
            QuadRound  quadRound  = new QuadRound();
            FinalRound finalRound = new FinalRound();

            preRound.InputTeams = worldCup.TeamList;

            playOff.InputTeams = preRound.Play();
            resultPlayOff      = playOff.Play();
            matchesPlayOff     = playOff.MatchList;

            octRound.InputTeams = new List <Team>(resultPlayOff);
            resultOct           = octRound.Play();
            matchesOct          = octRound.MatchList;

            quadRound.InputTeams = new List <Team>(resultOct);
            resultQuad           = quadRound.Play();
            matchesQuad          = quadRound.MatchList;

            finalRound.InputTeams = new List <Team>(resultQuad);
            Team championship = finalRound.Play()[0];

            matchesFinal = finalRound.MatchList;

            groupA.OnClick += Group_OnClick;
            groupB.OnClick += Group_OnClick;
            groupC.OnClick += Group_OnClick;
            groupD.OnClick += Group_OnClick;
            groupE.OnClick += Group_OnClick;
            groupF.OnClick += Group_OnClick;
            groupG.OnClick += Group_OnClick;
            groupH.OnClick += Group_OnClick;

            sc1.OnClick += Sc_Playoff;
            sc2.OnClick += Sc_Playoff;
            sc3.OnClick += Sc_Playoff;
            sc4.OnClick += Sc_Playoff;
            sc5.OnClick += Sc_Playoff;
            sc6.OnClick += Sc_Playoff;
            sc7.OnClick += Sc_Playoff;
            sc8.OnClick += Sc_Playoff;

            groupQuad1.OnClick += GroupQuad_OnClick;
            groupQuad2.OnClick += GroupQuad_OnClick;
            groupQuad3.OnClick += GroupQuad_OnClick;
            groupQuad4.OnClick += GroupQuad_OnClick;

            scQ1.OnClick += ScQ_OnClick;
            scQ2.OnClick += ScQ_OnClick;
            scQ3.OnClick += ScQ_OnClick;
            scQ4.OnClick += ScQ_OnClick;
        }
示例#2
0
        private void Init(IProvider provider)
        {
            worldCup = new Worldcup();
            worldCup.TeamProvider = provider;

            preRound  = new PreRound();
            playOff   = new PlayOff();
            octRound  = new OctRound();
            quadRound = new QuadRound();

            preRound.InputTeams  = worldCup.TeamList;
            playOff.InputTeams   = preRound.Play();
            octRound.InputTeams  = playOff.Play();
            quadRound.InputTeams = octRound.Play();
        }
示例#3
0
 public void Has4WonTeam()
 {
     Init(new TextProvider());
     Assert.AreEqual(4, octRound.Play().Count);
 }