41#include <magic_enum/magic_enum.hpp>
142 return hash == other.hash;
149 template <Color S
ide>
152 if constexpr (Side == Color::White)
159 template <Color S
ide>
162 if constexpr (Side == Color::White)
169 template <Color S
ide>
172 if constexpr (Side == Color::White)
242 [[nodiscard]]
auto is_file_open(
File file)
const noexcept -> bool;
249 [[nodiscard]]
auto get_open_files() const noexcept;
254 [[nodiscard]] auto is_file_half_open(
File file) const noexcept ->
bool;
261 [[nodiscard]] auto get_half_open_files() const noexcept;
269 template <Color S
ide>
270 [[nodiscard]]
auto get_passed_pawns() const noexcept ->
Bitboard;
273 template <
Color Side>
274 [[nodiscard]] auto get_backward_pawns() const noexcept ->
Bitboard;
320 [[nodiscard]] auto
is_quiet(
Move move) const noexcept ->
bool;
344 [[nodiscard]] auto
is_illegal() const -> std::optional<std::
string>;
355 [[nodiscard]] auto is_side_in_check(
Color side) const noexcept ->
bool;
441 return threefoldChecker.is_threefold();
444inline auto Position::is_side_in_check(
const Color side)
const noexcept ->
bool
446 if (side == Color::White) {
459 copy.make_move(move);
466 return move.piece() == PieceType::Pawn
478 return not(move.is_promotion() or
is_capture(move));
488 return magic_enum::enum_values<File>()
489 | std::views::filter([
this](
const File file) {
return is_file_open(file); });
494 const bool whiteOpen =
whitePieces.is_file_half_open(file);
495 const bool blackOpen =
blackPieces.is_file_half_open(file);
498 return whiteOpen != blackOpen;
503 return magic_enum::enum_values<File>()
518 return friendlyPawns & mask.inverse();
535 ourAttackSpans.inverse() & theirAttacks);
537 return backwardArea & friendlyPawns;
544 auto copy { starting };
546 copy.make_move(move);
553 auto copy { starting };
555 copy.make_null_move();
562 auto copy { starting };
constexpr auto pawn_rear(Bitboard starting) noexcept -> Bitboard
constexpr auto pawn_front(Bitboard starting) noexcept -> Bitboard
auto after_move(const Position &starting, Move move) -> Position
auto flipped(const Position &starting) -> Position
auto after_null_move(const Position &starting) -> Position
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 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
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
auto is_file_half_open(File file) const noexcept -> bool