41#include <magic_enum/magic_enum.hpp>
150 return hash == other.hash;
157 template <Color S
ide>
160 if constexpr (Side == Color::White)
167 template <Color S
ide>
170 if constexpr (Side == Color::White)
177 template <Color S
ide>
180 if constexpr (Side == Color::White)
250 [[nodiscard]]
auto is_file_open(
File file)
const noexcept -> bool;
257 [[nodiscard]]
auto get_open_files() const noexcept;
262 [[nodiscard]] auto is_file_half_open(
File file) const noexcept ->
bool;
269 [[nodiscard]] auto get_half_open_files() const noexcept;
277 template <Color S
ide>
278 [[nodiscard]]
auto get_passed_pawns() const noexcept ->
Bitboard;
281 template <
Color Side>
282 [[nodiscard]] auto get_backward_pawns() const noexcept ->
Bitboard;
328 [[nodiscard]] auto
is_quiet(
Move move) const noexcept ->
bool;
352 [[nodiscard]] auto
is_illegal() const -> std::optional<std::
string>;
372 return threefoldChecker.repetition_count();
376 [[nodiscard]]
auto is_side_in_check(
Color side)
const noexcept -> bool;
390 const Position& starting, Move move)
399[[nodiscard, gnu::pure]]
auto after_null_move(
const Position& starting) -> Position;
407[[nodiscard, gnu::pure]]
auto flipped(
const Position& starting) -> Position;
462 return threefoldChecker.is_threefold();
465inline auto Position::is_side_in_check(
const Color side)
const noexcept ->
bool
467 if (side == Color::White) {
469 blackPieces, whitePieces.king, whitePieces.occupied);
473 whitePieces, blackPieces.king, blackPieces.occupied);
480 copy.make_move(move);
487 return move.piece() == PieceType::Pawn
499 return not(move.is_promotion() or
is_capture(move));
509 return magic_enum::enum_values<File>()
510 | std::views::filter([
this](
const File file) {
return is_file_open(file); });
515 const bool whiteOpen =
whitePieces.is_file_half_open(file);
516 const bool blackOpen =
blackPieces.is_file_half_open(file);
519 return whiteOpen != blackOpen;
524 return magic_enum::enum_values<File>()
539 return friendlyPawns & mask.inverse();
556 ourAttackSpans.inverse() & theirAttacks);
558 return backwardArea & friendlyPawns;
565 auto copy { starting };
567 copy.make_move(move);
574 auto copy { starting };
576 copy.make_null_move();
583 auto copy { starting };
constexpr auto pawn_rear(Bitboard starting) noexcept -> Bitboard
constexpr auto pawn_front(Bitboard starting) noexcept -> Bitboard
auto print_utf8(const Position &position) -> std::string
auto print_ascii(const Position &position) -> std::string
constexpr auto squares_attacked(const Pieces &pieces, Bitboard targetSquares, Bitboard enemyPieces) noexcept -> bool
constexpr auto pawn_attacks(Bitboard starting) noexcept -> Bitboard
constexpr auto other_side() noexcept -> Color
auto flipped(const Position &starting) -> Position
auto after_null_move(const Position &starting) -> Position
auto after_move(const Position &starting, const Move move) -> Position
auto is_en_passant(Move move) const noexcept -> bool
std::optional< Square > enPassantTargetSquare
auto is_checkmate() const -> bool
auto is_legal(Move move) const -> bool
auto is_fifty_move_draw() const -> bool
auto our_pieces() const noexcept -> const Pieces &
auto get_result() const -> std::optional< Result >
auto pieces_for() noexcept -> Pieces &
auto their_pieces() noexcept -> Pieces &
auto get_half_open_files() const noexcept
auto is_black_to_move() const noexcept -> bool
static auto empty() -> Position
auto is_file_open(File file) const noexcept -> bool
auto get_open_files() const noexcept
std::uint_least8_t halfmoveClock
auto our_pieces() noexcept -> Pieces &
auto get_backward_pawns() const noexcept -> Bitboard
auto occupied() const noexcept -> Bitboard
auto their_pieces() const noexcept -> const Pieces &
auto get_passed_pawns() const noexcept -> Bitboard
std::uint_least64_t fullMoveCounter
auto pieces_for() const noexcept -> const Pieces &
auto is_illegal() const -> std::optional< std::string >
auto is_capture(Move move) const noexcept -> bool
void make_move(Move move)
CastlingRights blackCastlingRights
auto castling_rights_for() const noexcept -> CastlingRights
auto is_quiet(Move move) const noexcept -> bool
auto operator==(const Position &other) const noexcept -> bool
CastlingRights whiteCastlingRights
auto is_stalemate() const -> bool
void sanitize_ep_square()
auto is_draw() const -> bool
auto free() const noexcept -> Bitboard
auto is_check() const noexcept -> bool
auto is_draw_by_insufficient_material() const noexcept -> bool
auto is_threefold_repetition() const noexcept -> bool
auto is_white_to_move() const noexcept -> bool
constexpr auto get_repetition_count() const noexcept -> size_t
auto is_file_half_open(File file) const noexcept -> bool