Beispiel #1
0
        public bool Check(Player host, List <goalScorer> scorers)
        {
            if (host == null)
            {
                return(false);
            }
            //pool
            Score = 0;
            int x = 0;

            foreach (PoolMatchResult result in Results)
            {
                PoolMatchResult hostresult = host.Results[x];
                if (hostresult != null || result != null)
                {
                    if (hostresult.ScoreA != 99)
                    {
                        if (hostresult.Winner == result.Winner)
                        {
                            Score += 60;
                        }

                        if (hostresult.ScoreA == result.ScoreA)
                        {
                            Score += 20;
                        }

                        if (hostresult.ScoreB == result.ScoreB)
                        {
                            Score += 20;
                        }
                    }
                }
                x++;
            }

            //knockout
            int checkscore = KnockOut.checkKnockoutPhase(host.KnockOut);

            if (checkscore != -1)
            {
                Score += checkscore;
            }

            Score += Questions.CheckBonus(host.Questions);
            var s = findGoalscorer(scorers, Questions.Answers[BonusKeys.Topscorer].Answer);

            if (s != null)
            {
                Score += (s.goals * 20);
            }
            return(true);
        }