18 using TeamZarray_t = array<PieceZarray_t, gameboard::kNumPieceTypeVals>;
28 static std::shared_ptr<ZobristCalculatorForConcepts<K>>
Create(
29 uint32_t
seed = std::random_device{}()
31 return std::shared_ptr<ZobristCalculatorForConcepts<K>>(
66 for (
auto color_idx = 0; color_idx < 2; color_idx++) {
68 for (
auto rank = 0; rank <
kNumRanks; rank++) {
69 for (
auto file = 0; file <
kNumFiles; file++) {
70 game_zarray[color_idx][piece_id][rank][file] = key_generator.
GenerateKey();
88 if (board_map[rank][file].piece_color != 0) {
90 board_map[rank][file].piece_color,
91 board_map[rank][file].piece_type,
Constants, typedefs, and simple structs used by gameboard::GameBoard.
Generates pseudorandom integers.
IntType GenerateKey()
Generates a pseudorandom IntType value using mt19937.
Uses Zobrist hashing to calculate a "reasonably unique" integer value for each board configuration en...
void UpdateBoardStateInternal(const gameboard::ExecutedMove &executed_move)
static std::shared_ptr< ZobristCalculatorForConcepts< K > > Create(uint32_t seed=std::random_device{}())
K GetHashValueAt(PieceColor color, PieceType piece_type, BoardSpace space)
array< TeamZarray_t, 2 > GameZarray_t
void FullBoardStateCalc(const gameboard::BoardMap_t &board_map)
array< PieceZarray_t, gameboard::kNumPieceTypeVals > TeamZarray_t
void UpdateBoardState(const gameboard::ExecutedMove &executed_move)
static const GameZarray_t CreateGameZarray(PseudoRandomKeyGenerator< K > &key_generator)
Static helper method for building 4-D array of Zobrist keys in constuctor.
KeyType board_state() const
ZobristCalculatorForConcepts(uint32_t seed=std::random_device{}())
Constructs a ZobristCalculatorForConcepts.
array< array< K, gameboard::kNumFiles >, gameboard::kNumRanks > PieceZarray_t
void FullBoardStateCalcInternal(const gameboard::BoardMap_t &board_map)
Declaration of boardstate::KeyGenerator and implementation of its template methods.
Definitions and implementations of gameboard::Move and other move-related structs.
Calculate / manage board state and associate Minimax results.
size_t GetZColorIndexOf(PieceColor color)
const BoardIndexType kNumFiles
const BoardIndexType kNumRanks
array< array< GamePiece, kNumFiles >, kNumRanks > BoardMap_t
2-D array of gameboard::GamePiece objects.
const int kNumPieceTypeVals
A pair of coordinate (rank, and file) with properties determined by comparison with values of gameboa...
A change in the state of a gameboard::GameBoard represented by a gameboard::Move, and each of the gam...
gameboard::GamePiece moving_piece
gameboard::GamePiece destination_piece
gameboard::BoardSpace end
gameboard::BoardSpace start