39 moves.reserve(reserve_size);
47 for (
auto entry :
moves) {
48 if ((move.
start == entry.start) && (move.
end == entry.end)) {
56 for (
auto &entry :
moves) {
66 return moves[selected_move_index];
70 for (
auto move :
moves) {
71 if (move.end == space) {
79 void Concat(vector<Move> other_moves) {
80 moves.insert(
moves.end(), other_moves.begin(), other_moves.end());
Constants, typedefs, and simple structs used by gameboard::GameBoard.
Defines GamePiece and supporting constants and free functions.
Tracking piece positions and determining legal moves.
T random(T range_from, T range_to)
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
MoveCountType moves_since_last_capture
gameboard::GamePiece destination_piece
bool operator==(const ExecutedMove other)
== operator overload; requires equality of pieces and space, but not moves_since_last capture.
A Xiangqi game piece described by its gameboard::PieceType and its gameboard::PieceColor.
A container for multiple gameboard::Move objects.
void Concat(vector< Move > other_moves)
void Concat(MoveCollection other)
bool ContainsMove(const Move &move) const
bool ContainsAnyMoveNotIn(const MoveCollection &other) const
MoveCollection(size_t reserve_size)
bool ContainsDestination(const gameboard::BoardSpace &space)
MoveCollection(vector< Move > my_moves)
A gameboard::BoardSpace pair (start and end).
gameboard::BoardSpace end
bool operator==(const Move &other) const
gameboard::BoardSpace start
Defiition of miscellaneous free functions (and implementation of those that are templates).