コード例 #1
0
 public AdvantageSetGameCounter(IParametricFactory <IPointCounter, EnumTeams> normalGamePointCounterFactory, int leastWinningGames, int leastWinningDifference, EnumTeams initialServiceRight)
     : base(normalGamePointCounterFactory?.Create(initialServiceRight) ?? throw new ArgumentNullException(nameof(normalGamePointCounterFactory)), initialServiceRight)
 {
     NormalGamePointCounterFactory = normalGamePointCounterFactory ?? throw new ArgumentNullException(nameof(normalGamePointCounterFactory));
     LeastWinningGames             = leastWinningGames > 0 ? leastWinningGames :
                                     throw new ArgumentOutOfRangeException(nameof(leastWinningGames), $"The leastWinningGames must be grater than 0!");
     LeastWinningDifference = leastWinningDifference >= 0 ? leastWinningDifference :
                              throw new ArgumentOutOfRangeException(nameof(leastWinningDifference), $"The leastWinningGames must be grater than or equal to 0!");
 }
コード例 #2
0
 public TieBreakSetGameCounter(IParametricFactory <IPointCounter, EnumTeams> normalGamePointCounterFactory,
                               IParametricFactory <TieBrakingPointCounter, EnumTeams> tieBreakingGamePointCounterFactory, int leastWinningGames, int baseWinningDifference, EnumTeams initialServiceRight)
     : base(normalGamePointCounterFactory?.Create(initialServiceRight) ?? throw new ArgumentNullException(nameof(normalGamePointCounterFactory)), initialServiceRight)
 {
     NormalGamePointCounterFactory      = normalGamePointCounterFactory ?? throw new ArgumentNullException(nameof(normalGamePointCounterFactory));
     TieBreakingGamePointCounterFactory = tieBreakingGamePointCounterFactory ?? throw new ArgumentNullException(nameof(tieBreakingGamePointCounterFactory));
     LeastWinningGames     = leastWinningGames;
     BaseWinningDifference = baseWinningDifference;
 }
コード例 #3
0
 public StandardSetCounter(IParametricFactory <IGameCounter, EnumTeams> gameCounterFactory, int totalSets, EnumTeams initialServiceRight)
     : base(gameCounterFactory?.Create(initialServiceRight) ?? throw new ArgumentNullException(nameof(gameCounterFactory)), initialServiceRight)
 {
     GameCounterFactory = gameCounterFactory ?? throw new ArgumentNullException(nameof(gameCounterFactory));
     TotalSets          = totalSets;
 }
コード例 #4
0
 public MatchTieBreakSetCounter(IParametricFactory <IGameCounter, EnumTeams> gameCounterFactory, int totalSets, int matchTieBreakPointCount,
                                int matchTieBreakPointLeastDifference, EnumTeams initialServiceRight) : base(gameCounterFactory.Create(initialServiceRight) ??
                                                                                                             throw new ArgumentNullException(nameof(gameCounterFactory)), initialServiceRight)
 {
     GameCounterFactory                = gameCounterFactory ?? throw new ArgumentNullException(nameof(gameCounterFactory));
     TotalSets                         = totalSets;
     MatchTieBreakPointCount           = matchTieBreakPointCount;
     MatchTieBreakPointLeastDifference = matchTieBreakPointLeastDifference;
 }