Example #1
0
        void CreateFinalMatch()
        {
            if (!_bet.HasSemiFinals())
            {
                return;
            }

            var k = new KnockoutMatch();

            k.SelectedMatch = _bet.GetSemiFinalWinners()[0] + " vs. " + _bet.GetSemiFinalWinners()[1];
            if (_bet.HasFinal())
            {
                k.SelectedWinner = _bet.GetFinalWinner();
            }
            if (_results.HasSemiFinals())
            {
                k.ActualMatch = _results.GetSemiFinalWinners()[0] + " vs. " + _results.GetSemiFinalWinners()[1];
                if (_results.HasFinal())
                {
                    k.ActualWinner = _results.GetFinalWinner();
                    k.CellClass    = GetSelectedWinnerClass(k.SelectedWinner, _results.GetFinalWinner());
                }
            }
            _final.Add(k);
        }
Example #2
0
        void CreateBronseFinalMatch()
        {
            if (!_bet.HasSemiFinals())
            {
                return;
            }

            var k = new KnockoutMatch();

            k.SelectedMatch = _bet.GetBronseFinalists()[0] + " vs. " + _bet.GetBronseFinalists()[1];
            if (_bet.HasBronseFinal())
            {
                k.SelectedWinner = _bet.GetBronseFinalWinner();
            }
            if (_results.HasSemiFinals())
            {
                var bf = _results.GetBronseFinalists();
                if (bf.Count > 0)
                {
                    k.ActualMatch = _results.GetBronseFinalists()[0] + " vs. " + _results.GetBronseFinalists()[1];
                }
                else
                {
                    k.ActualMatch = "- vs. -";
                }
                if (_results.HasBronseFinal())
                {
                    k.ActualWinner = _results.GetBronseFinalWinner();
                    k.CellClass    = GetSelectedWinnerClass(k.SelectedWinner, _results.GetBronseFinalWinner());
                }
            }
            _bronseFinal.Add(k);
        }
Example #3
0
        KnockoutMatch Add16Match(int i1, int i2)
        {
            var k = new KnockoutMatch();

            k.SelectedMatch = _bet.GetStageOne().winners[i1][0] + " vs. " + _bet.GetStageOne().winners[i2][1];
            if (_bet.HasRound16())
            {
                k.SelectedWinner = _bet.GetRound16Winners()[i1].ToString();
            }
            k.ActualMatch = _stageOneActual.winners[i1][0] + " vs. " + _stageOneActual.winners[i2][1];
            if (_results.HasRound16())
            {
                k.ActualWinner = _results.GetRound16Winners()[i1].ToString();
                k.CellClass    = GetSelectedWinnerClass(k.SelectedWinner, _results.GetRound16Winners());
            }
            return(k);
        }
Example #4
0
        KnockoutMatch AddQuarterFinalMatch(int i1, int i2, int qw)
        {
            var k = new KnockoutMatch();

            k.SelectedMatch = _bet.GetRound16Winners()[i1] + " vs. " + _bet.GetRound16Winners()[i2];
            if (_bet.HasQuarterFinals())
            {
                k.SelectedWinner = _bet.GetQuarterFinalWinners()[qw].ToString();
            }
            if (_results.HasRound16())
            {
                k.ActualMatch = _results.GetRound16Winners()[i1] + " vs. " + _results.GetRound16Winners()[i2];
                if (_results.HasQuarterFinals())
                {
                    k.ActualWinner = _results.GetQuarterFinalWinners()[qw].ToString();
                    k.CellClass    = GetSelectedWinnerClass(k.SelectedWinner, _results.GetQuarterFinalWinners());
                }
            }
            return(k);
        }
Example #5
0
        KnockoutMatch AddSemiFinalMatch(int i1, int i2)
        {
            int sw = (i1 < 2) ? i1 : i1 - 1;
            var k  = new KnockoutMatch();

            k.SelectedMatch = _bet.GetQuarterFinalWinners()[i1] + " vs. " + _bet.GetQuarterFinalWinners()[i2];
            if (_bet.HasSemiFinals())
            {
                k.SelectedWinner = _bet.GetSemiFinalWinners()[sw].ToString();
            }
            if (_results.HasQuarterFinals())
            {
                k.ActualMatch = _results.GetQuarterFinalWinners()[i1] + " vs. " + _results.GetQuarterFinalWinners()[i2];
                if (_results.HasSemiFinals())
                {
                    k.ActualWinner = _results.GetSemiFinalWinners()[sw].ToString();
                    k.CellClass    = GetSelectedWinnerClass(k.SelectedWinner, _results.GetSemiFinalWinners());
                }
            }
            return(k);
        }
Example #6
0
        void CreateEuroRound16Matches()
        {
            List <string> userMatches = new List <string>();

            if (_bet.HasThirdPlaces())
            {
                userMatches = GetListOfMatches(_bet.GetStageOne().winners, _bet.GetThirdPlaces());
            }

            // Repeat for actual results
            List <string> resultMatches = new List <string>();

            if (_results.HasThirdPlaces())
            {
                resultMatches = GetListOfMatches(_stageOneActual.winners, _results.GetThirdPlaces());
            }

            for (int i = 0; i < userMatches.Count; i++)
            {
                var k = new KnockoutMatch();
                if (_bet.HasThirdPlaces())
                {
                    k.SelectedMatch = userMatches[i];
                    if (_bet.HasRound16())
                    {
                        k.SelectedWinner = _bet.GetRound16Winners()[i].ToString();
                    }
                }
                if (_results.HasThirdPlaces())
                {
                    k.ActualMatch = resultMatches[i];
                    if (_results.HasRound16())
                    {
                        k.ActualWinner = _results.GetRound16Winners()[i].ToString();
                        k.CellClass    = GetSelectedWinnerClass(k.SelectedWinner, _results.GetRound16Winners());
                    }
                }
                _round16.Add(k);
            }
        }