Xiangiqgame
AI engine for Xiangqi
Loading...
Searching...
No Matches
moveselection::RandomMoveEvaluatorForConcepts Class Reference

Complies with MoveEvaluatorConcept. More...

#include <move_evaluator_random_for_concepts.hpp>

Inheritance diagram for moveselection::RandomMoveEvaluatorForConcepts:
Inheritance graph
Collaboration diagram for moveselection::RandomMoveEvaluatorForConcepts:
Collaboration graph

Public Member Functions

gameboard::Move SelectMove (const gameboard::MoveCollection &allowed_moves)
 Randomly selects move from collection of allowed moves.
 
void NotifyIllegalMove ()
 
- Public Member Functions inherited from MoveEvaluatorBase
virtual gameboard::Move SelectMove (const gameboard::MoveCollection &allowed_moves)=0
 
virtual void NotifyIllegalMove ()=0
 
virtual const std::optional< moveselection::SearchSummariessearch_summaries () const
 
virtual ~MoveEvaluatorBase ()=default
 

Static Public Member Functions

static std::unique_ptr< RandomMoveEvaluatorForConceptsCreate (gameboard::PieceColor evaluating_player)
 Instantiates RandomMoveEvaluatorForConcepts in heap.
 

Private Member Functions

 RandomMoveEvaluatorForConcepts (gameboard::PieceColor evaluating_player)
 Constructor is private to force use of static Create method.
 

Private Attributes

gameboard::PieceColor evaluating_player_
 
std::mt19937_64 prng_
 

Detailed Description

Complies with MoveEvaluatorConcept.

Randomly chooses one of legal moves available to moveselection::RandomMoveEvaluator.evaluating_player_.

Definition at line 18 of file move_evaluator_random_for_concepts.hpp.

Constructor & Destructor Documentation

◆ RandomMoveEvaluatorForConcepts()

moveselection::RandomMoveEvaluatorForConcepts::RandomMoveEvaluatorForConcepts ( gameboard::PieceColor  evaluating_player)
private

Constructor is private to force use of static Create method.

Definition at line 8 of file move_evaluator_random_for_concepts.cpp.

Member Function Documentation

◆ Create()

std::unique_ptr< RandomMoveEvaluatorForConcepts > moveselection::RandomMoveEvaluatorForConcepts::Create ( gameboard::PieceColor  evaluating_player)
static

Instantiates RandomMoveEvaluatorForConcepts in heap.

Definition at line 14 of file move_evaluator_random_for_concepts.cpp.

◆ NotifyIllegalMove()

void moveselection::RandomMoveEvaluatorForConcepts::NotifyIllegalMove ( )
virtual

Implements MoveEvaluatorBase.

Definition at line 30 of file move_evaluator_random_for_concepts.cpp.

◆ SelectMove()

gameboard::Move moveselection::RandomMoveEvaluatorForConcepts::SelectMove ( const gameboard::MoveCollection allowed_moves)
virtual

Randomly selects move from collection of allowed moves.

Implements MoveEvaluatorBase.

Definition at line 22 of file move_evaluator_random_for_concepts.cpp.

Member Data Documentation

◆ evaluating_player_

gameboard::PieceColor moveselection::RandomMoveEvaluatorForConcepts::evaluating_player_
private

Definition at line 19 of file move_evaluator_random_for_concepts.hpp.

◆ prng_

std::mt19937_64 moveselection::RandomMoveEvaluatorForConcepts::prng_
private

Definition at line 20 of file move_evaluator_random_for_concepts.hpp.


The documentation for this class was generated from the following files: