Xiangiqgame
AI engine for Xiangqi
Loading...
Searching...
No Matches
space_info_provider.hpp
Go to the documentation of this file.
1#pragma once
2
6#include <concepts>
7
8
9template <typename T>
10concept SpaceInfoProviderConcept = requires(
11 T t,
14 gameboard::Move &move,
15 gameboard::ExecutedMove &executed_move,
16 const gameboard::BoardMapInt_t &starting_board
17 ) {
18 {
19 t.GetAllSpacesOccupiedBy(color)
20 } -> std::same_as<std::vector<gameboard::BoardSpace>>;
21 {t.GetColor(space)} -> std::same_as<gameboard::PieceColor>;
22 {t.GetType(space)} -> std::same_as<gameboard::PieceType>;
23 {t.CalcFinalMovesOf(color)} -> std::same_as<gameboard::MoveCollection>;
24 {t.ExecuteMove(move)} -> std::same_as<gameboard::ExecutedMove>;
25 {t.UndoMove(executed_move)} -> std::same_as<void>;
26 {t.IsDraw()} -> std::same_as<bool>;
27 {t.map()} -> std::same_as<const gameboard::BoardMap_t&>;
28 {t.Create(starting_board)} -> std::same_as<std::shared_ptr<T>>;
29};
Constants, typedefs, and simple structs used by gameboard::GameBoard.
Defines GamePiece and supporting constants and free functions.
Definitions and implementations of gameboard::Move and other move-related structs.
array< array< int, kNumFiles >, kNumRanks > BoardMapInt_t
2-D array of integers; can be converted to gameboard::BoardMap_t using gameboard::int_board_to_game_p...
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...
A gameboard::BoardSpace pair (start and end).