X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.h;h=d05546f75ff7d6cae1157d92be10ae79b86eb37c;hp=33f3937738db900bb0c1ada00af6140c650e19c0;hb=1d2247aea39074d8ecea4a5ce81b1cf85165538e;hpb=76381cbd6903f8be571cbc0d644a0f78026134bc diff --git a/src/position.h b/src/position.h index 33f39377..d05546f7 100644 --- a/src/position.h +++ b/src/position.h @@ -86,8 +86,8 @@ struct UndoInfo { Key key, pawnKey, materialKey; int rule50; Move lastMove; - PieceType capture; Value mgValue, egValue; + PieceType capture; }; @@ -308,6 +308,9 @@ private: void undo_ep_move(Move m); void find_checkers(); + template + void update_checkers(Bitboard* pCheckersBB, Square ksq, Square from, Square to, Bitboard dcCandidates); + template Bitboard hidden_checks(Color c, Square ksq) const; @@ -571,6 +574,16 @@ Bitboard Position::piece_attacks_square(Square f, Square t) const { return bit_is_set(piece_attacks(f), t); } +inline Bitboard Position::attacks_to(Square s, Color c) const { + + return attacks_to(s) & pieces_of_color(c); +} + +inline bool Position::square_is_attacked(Square s, Color c) const { + + return attacks_to(s, c) != EmptyBoardBB; +} + inline bool Position::pawn_is_passed(Color c, Square s) const { return !(pawns(opposite_color(c)) & passed_pawn_mask(c, s)); }