]> git.sesse.net Git - stockfish/commitdiff
Rename Position::hidden_checkers to check_blockers
authorHenri Wiechers <hwiechers@gmail.com>
Sat, 11 Jan 2014 09:58:09 +0000 (11:58 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 11 Jan 2014 19:10:46 +0000 (04:10 +0900)
No functional change.

src/position.cpp
src/position.h

index 55a4c4a2fa0e0ca56ae6fe3832a2649698ad3963..325f3e4db6b2ce023eadef0e575e0245237ec0f3 100644 (file)
@@ -411,11 +411,14 @@ const string Position::pretty(Move move) const {
 }
 
 
 }
 
 
-/// Position:hidden_checkers() returns a bitboard of all pinned / discovered check
-/// pieces, according to the call parameters. Pinned pieces protect our king and
-/// discovered check pieces attack the enemy king.
-
-Bitboard Position::hidden_checkers(Color c, Color kingColor) const {
+/// Position::check_blockers() returns a bitboard of all the pieces with color
+/// 'c' that are blocking check on the king with color 'kingColor'. A piece
+/// blocks a check if removing that piece from the board would result in a
+/// position where the king is in check. A check blocking piece can be either a
+/// pinned or a discovered check piece, according if its color 'c' is the same
+/// or the opposite of 'kingColor'.
+
+Bitboard Position::check_blockers(Color c, Color kingColor) const {
 
   Bitboard b, pinners, result = 0;
   Square ksq = king_square(kingColor);
 
   Bitboard b, pinners, result = 0;
   Square ksq = king_square(kingColor);
index f145249c75051cd50403e550ab23a28576a92ace..8fc62c9894d614af730d9e2d405a9da991362d0d 100644 (file)
@@ -174,7 +174,7 @@ private:
 
   // Helper functions
   void do_castling(Square kfrom, Square kto, Square rfrom, Square rto);
 
   // Helper functions
   void do_castling(Square kfrom, Square kto, Square rfrom, Square rto);
-  Bitboard hidden_checkers(Color c, Color kingColor) const;
+  Bitboard check_blockers(Color c, Color kingColor) const;
   void put_piece(Square s, Color c, PieceType pt);
   void remove_piece(Square s, Color c, PieceType pt);
   void move_piece(Square from, Square to, Color c, PieceType pt);
   void put_piece(Square s, Color c, PieceType pt);
   void remove_piece(Square s, Color c, PieceType pt);
   void move_piece(Square from, Square to, Color c, PieceType pt);
@@ -315,11 +315,11 @@ inline Bitboard Position::checkers() const {
 }
 
 inline Bitboard Position::discovered_check_candidates() const {
 }
 
 inline Bitboard Position::discovered_check_candidates() const {
-  return hidden_checkers(sideToMove, ~sideToMove);
+  return check_blockers(sideToMove, ~sideToMove);
 }
 
 inline Bitboard Position::pinned_pieces(Color c) const {
 }
 
 inline Bitboard Position::pinned_pieces(Color c) const {
-  return hidden_checkers(c, c);
+  return check_blockers(c, c);
 }
 
 inline bool Position::pawn_passed(Color c, Square s) const {
 }
 
 inline bool Position::pawn_passed(Color c, Square s) const {