/// <summary>
        ///     Initializes a new instance of the <see cref="EnginePlayerMoveSearcher"/> class
        ///     using the specified parameters.
        /// </summary>
        internal EnginePlayerMoveSearcher(
            [NotNull] ILogger logger,
            [NotNull] GameBoard rootBoard,
            int plyDepth,
            [NotNull] BoardHelper boardHelper,
            [CanBeNull] TranspositionTable transpositionTable,
            [CanBeNull] VariationLineCache previousIterationVariationLineCache,
            [NotNull] GameControlInfo gameControlInfo,
            bool useMultipleProcessors,
            [NotNull] MoveHistoryStatistics moveHistoryStatistics)
        {
            if (plyDepth < CommonEngineConstants.MaxPlyDepthLowerLimit)
            {
                throw new ArgumentOutOfRangeException(
                          nameof(plyDepth),
                          plyDepth,
                          $@"The value must be at least {CommonEngineConstants.MaxPlyDepthLowerLimit}.");
            }

            _logger             = logger ?? throw new ArgumentNullException(nameof(logger));
            _rootBoard          = rootBoard ?? throw new ArgumentNullException(nameof(rootBoard));
            _plyDepth           = plyDepth;
            _boardHelper        = boardHelper;
            _transpositionTable = transpositionTable;
            _previousIterationVariationLineCache = previousIterationVariationLineCache;
            _gameControlInfo       = gameControlInfo ?? throw new ArgumentNullException(nameof(gameControlInfo));
            _useMultipleProcessors = useMultipleProcessors;
            _moveHistoryStatistics = moveHistoryStatistics ?? throw new ArgumentNullException(nameof(moveHistoryStatistics));
            _evaluator             = new Evaluator(gameControlInfo, boardHelper);

            VariationLineCache = new VariationLineCache(rootBoard);
        }
Esempio n. 2
0
 internal Evaluator([NotNull] GameControlInfo gameControlInfo, [NotNull] BoardHelper boardHelper)
 {
     _gameControlInfo = gameControlInfo ?? throw new ArgumentNullException(nameof(gameControlInfo));
     _boardHelper     = boardHelper ?? throw new ArgumentNullException(nameof(boardHelper));
 }