]> git.sesse.net Git - stockfish/blobdiff - src/position.h
Remove semiopenFiles in pawns and simplify space #2102
[stockfish] / src / position.h
index 03c00148a084636fbeac4370f55635890ec0c46f..1351d0d125a6b60a4d14d78aaf071af638417b92 100644 (file)
@@ -95,6 +95,7 @@ public:
   template<PieceType Pt> int count() const;
   template<PieceType Pt> const Square* squares(Color c) const;
   template<PieceType Pt> Square square(Color c) const;
+  int semiopen_file(Color c, File f) const;
 
   // Castling
   int castling_rights(Color c) const;
@@ -260,6 +261,10 @@ inline Square Position::ep_square() const {
   return st->epSquare;
 }
 
+inline int Position::semiopen_file(Color c, File f) const {
+  return !(pieces(c, PAWN) & file_bb(f));
+}
+
 inline bool Position::can_castle(CastlingRight cr) const {
   return st->castlingRights & cr;
 }