Xiangiqgame
AI engine for Xiangqi
Loading...
Searching...
No Matches
board_state_calculator.hpp
Go to the documentation of this file.
1#pragma once
2
4#include <concepts>
5#include <memory>
7
8template <typename T>
9concept BoardStateCalculatorConcept = requires(
10 T t,
11 const gameboard::BoardMap_t &board_map,
12 const gameboard::ExecutedMove &executed_move,
13 uint32_t seed
14
15) {
16 { t.FullBoardStateCalc(board_map) } -> std::same_as<void>;
17 { t.UpdateBoardState(executed_move) } -> std::same_as<void>;
18 { t.Create(seed) } -> std::same_as<std::shared_ptr<T>>;
19};
20
22
23public:
24 static std::shared_ptr<NullBoardStateCalculator> Create(uint32_t seed = 0) {
25 return std::shared_ptr<NullBoardStateCalculator>(new NullBoardStateCalculator());
26 }
27 void FullBoardStateCalc(const gameboard::BoardMap_t &board_map) {}
28 void UpdateBoardState(const gameboard::ExecutedMove &executed_move) {}
29
30private:
32};
Constants, typedefs, and simple structs used by gameboard::GameBoard.
void UpdateBoardState(const gameboard::ExecutedMove &executed_move)
static std::shared_ptr< NullBoardStateCalculator > Create(uint32_t seed=0)
NullBoardStateCalculator()=default
void FullBoardStateCalc(const gameboard::BoardMap_t &board_map)
Definitions and implementations of gameboard::Move and other move-related structs.
array< array< GamePiece, kNumFiles >, kNumRanks > BoardMap_t
2-D array of gameboard::GamePiece objects.
A change in the state of a gameboard::GameBoard represented by a gameboard::Move, and each of the gam...