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;
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;
}
// index[from] is not updated and becomes stale. This works as long as index[]
// is accessed just by known occupied squares.
- Bitboard fromTo = SquareBB[from] ^ SquareBB[to];
+ Bitboard fromTo = square_bb(from) | square_bb(to);
byTypeBB[ALL_PIECES] ^= fromTo;
byTypeBB[type_of(pc)] ^= fromTo;
byColorBB[color_of(pc)] ^= fromTo;