X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.h;h=2106414ba2dd4f3475bf5cb42e2149539e939abf;hp=a3fb16b8e6c2c871a6e9ac3ab5ca3e11d36f9863;hb=a016626825972d546d2e4ef6abd2e55f7bf2f3dc;hpb=4e72e2a964754611de85536c13ae069f85839b85 diff --git a/src/position.h b/src/position.h index a3fb16b8..2106414b 100644 --- a/src/position.h +++ b/src/position.h @@ -46,6 +46,7 @@ struct StateInfo { Square epSquare; // Not copied when making a move (will be recomputed anyhow) + int repetition; Key key; Bitboard checkersBB; Piece capturedPiece; @@ -95,7 +96,7 @@ public: template int count() const; template const Square* squares(Color c) const; template Square square(Color c) const; - bool is_semiopen_file(Color c, File f) const; + bool is_on_semiopen_file(Color c, Square s) const; // Castling int castling_rights(Color c) const; @@ -107,6 +108,7 @@ public: Bitboard checkers() const; Bitboard blockers_for_king(Color c) const; Bitboard check_squares(PieceType pt) const; + bool is_discovery_check_on_king(Color c, Move m) const; // Attacks to/from a given square Bitboard attackers_to(Square s) const; @@ -262,8 +264,8 @@ inline Square Position::ep_square() const { return st->epSquare; } -inline bool Position::is_semiopen_file(Color c, File f) const { - return !(pieces(c, PAWN) & file_bb(f)); +inline bool Position::is_on_semiopen_file(Color c, Square s) const { + return !(pieces(c, PAWN) & file_bb(s)); } inline bool Position::can_castle(CastlingRight cr) const { @@ -315,6 +317,10 @@ inline Bitboard Position::check_squares(PieceType pt) const { return st->checkSquares[pt]; } +inline bool Position::is_discovery_check_on_king(Color c, Move m) const { + return st->blockersForKing[c] & from_sq(m); +} + inline bool Position::pawn_passed(Color c, Square s) const { return !(pieces(~c, PAWN) & passed_pawn_span(c, s)); }