Ejemplo n.º 1
0
        private bool StartFinalSet()
        {
            while (IsFinalSetEnd())
            {
                _gamePointsFirst  = new GamePoints();
                _gamePointsSecond = new GamePoints();
                StartGame();
                if (_gamePointsFirst.Points == 60)
                {
                    _setGamesFirst++;
                }
                else
                {
                    _setGamesSecond++;
                }
            }

            if (_setGamesFirst > _setGamesSecond)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 2
0
        private bool SpecialSet()
        {
            _gamePointsFirst  = new GamePoints();
            _gamePointsSecond = new GamePoints();
            StartGame();
            if (_gamePointsFirst.Points == 60)
            {
                _setGamesFirst++;
            }
            else
            {
                _setGamesSecond++;
            }

            if (_setGamesFirst == _setGamesSecond)
            {
                if (_setPointsFirst == 1 && _setPointsSecond == 1)
                {
                    return(StartFinalSet());
                }
                else
                {
                    return(StartTiebreaker());
                }
            }

            if (_setGamesFirst == 7)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 3
0
 private void GamePointsManager(GamePoints first, GamePoints second)
 {
     if (second.Domination)
     {
         second.Domination = false;
     }
     else if (first.Domination)
     {
         first.Add();
     }
     else if (first.Points == 40 &&
              second.Points == 40)
     {
         first.Domination = true;
     }
     else
     {
         first.Add();
     }
 }
Ejemplo n.º 4
0
        private bool StartSet()
        {
            if (_tiebreakerGame) //Если был тай-брейк, но игра не закончилась
            {
                _tiebreakerGame = false;
            }

            while (IsSetEnd())
            {
                _gamePointsFirst  = new GamePoints();
                _gamePointsSecond = new GamePoints();
                StartGame();
                if (_gamePointsFirst.Points == 60)
                {
                    _setGamesFirst++;
                }
                else
                {
                    _setGamesSecond++;
                }
            }

            if (_setGamesFirst == 6 && _setGamesSecond == 5 ||
                _setGamesFirst == 5 && _setGamesSecond == 6)
            {
                return(SpecialSet());
            }

            if (_setGamesFirst == 6)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }