protected override SetCounterHistoryItem HandleIncrementB()
        {
            var npb = SetCountB + 1;

            if (CurrentGameCounter is MatchTieBreakFinalSetGameCounter || SatisfiesMatchEndingCondition(npb, SetCountA))
            {
                npb = -npb;
            }
            else
            {
                var       newPoint        = new TeamedValuePair <int>(SetCountA, npb);
                EnumTeams newServiceRight = CurrentGameCounter.CurrentServiceRight.Flip();
                return(new SetCounterHistoryItem(SatisfiesTieBreakCondition(npb, SetCountA) ?
                                                 new MatchTieBreakFinalSetGameCounter(new TieBrakingPointCounter(MatchTieBreakPointCount, MatchTieBreakPointLeastDifference, newServiceRight), newServiceRight) :
                                                 GameCounterFactory.Create(newServiceRight), newPoint, newServiceRight));
            }
            return(new SetCounterHistoryItem(null, new TeamedValuePair <int>(SetCountA, npb), CurrentServiceRight));
        }
Esempio n. 2
0
        protected override GameCounterHistoryItem HandleIncrementB()
        {
            var npb = GameCountB + 1;

            if (CurrentPointCounter is TieBrakingPointCounter || SatisfiesGameEndingCondition(npb, GameCountA))
            {
                npb = -npb;
                return(new GameCounterHistoryItem(null, new TeamedValuePair <int>(GameCountA, npb), CurrentServiceRight));
            }
            else
            {
                var       newPoints = new TeamedValuePair <int>(GameCountA, npb);
                EnumTeams nsr       = CurrentServiceRight.Flip();
                return(SatisfiesTieBreakingCondition(npb, GameCountA)
                    ? new GameCounterHistoryItem(TieBreakingGamePointCounterFactory.Create(nsr), newPoints, nsr)
                    : new GameCounterHistoryItem(NormalGamePointCounterFactory.Create(nsr), newPoints, nsr));
            }
        }
Esempio n. 3
0
 public PointCounterHistoryItem(TeamedValuePair <TPoint> pointCounts, EnumTeams serviceRight)
 {
     PointCounts  = pointCounts;
     ServiceRight = serviceRight;
 }
Esempio n. 4
0
 public void Deconstruct(out IPointCounter pointCounter, out TeamedValuePair <int> gameCounts, out EnumTeams serviceRight)
 {
     pointCounter = Counter;
     gameCounts   = GameCounts;
     serviceRight = ServiceRight;
 }
Esempio n. 5
0
 public GameCounterHistoryItem(IPointCounter counter, TeamedValuePair <int> gameCounts, EnumTeams serviceRight)
 {
     Counter      = counter;
     GameCounts   = gameCounts;
     ServiceRight = serviceRight;
 }
 public void Deconstruct(out IGameCounter gameCounter, out TeamedValuePair <int> setCounts, out EnumTeams serviceRight)
 {
     gameCounter  = GameCounter;
     setCounts    = SetCounts;
     serviceRight = ServiceRight;
 }
 public SetCounterHistoryItem(IGameCounter gameCounter, TeamedValuePair <int> setCounts, EnumTeams serviceRight)
 {
     GameCounter  = gameCounter;
     SetCounts    = setCounts;
     ServiceRight = serviceRight;
 }