11 : evaluating_player_{evaluating_player}
12 , prng_{std::mt19937_64{std::random_device{}()}} {}
17 return std::unique_ptr<RandomMoveEvaluatorForConcepts>(
25 std::uniform_int_distribution<size_t> distr(0, allowed_moves.
Size() - 1);
26 auto selected_move_index = distr(
prng_);
27 return allowed_moves.
moves[selected_move_index];
31 throw std::runtime_error(
"RandomMoveEvaluator selected an illegal move");
std::unique_ptr< MoveEvaluatorBase > Create(gameboard::PieceColor evaluating_player) override
Complies with MoveEvaluatorConcept.
gameboard::Move SelectMove(const gameboard::MoveCollection &allowed_moves)
Randomly selects move from collection of allowed moves.
static std::unique_ptr< RandomMoveEvaluatorForConcepts > Create(gameboard::PieceColor evaluating_player)
Instantiates RandomMoveEvaluatorForConcepts in heap.
RandomMoveEvaluatorForConcepts(gameboard::PieceColor evaluating_player)
Constructor is private to force use of static Create method.
Selecting a move to execute.
A container for multiple gameboard::Move objects.
A gameboard::BoardSpace pair (start and end).