Tennis.TennisSet.AddPoint C# (CSharp) Method

AddPoint() public method

public AddPoint ( Party party ) : void
party Party
return void
        public void AddPoint(Party party)
        {
            if (SetOver)
                throw new InvalidOperationException("Cannot add points to won sets.");

            _currentGame.AddPoint(party);

            if (_currentGame.GameOver)
            {
                IncreaseScore(party);
                _setState = _setState.GameAdded(party);

                if (!_setState.SetOver)
                    _currentGame = _setState.GetNextGame(_tournamentRules);
            }
        }