1
0
Fork 0

update board representation

This commit is contained in:
Paul-Nicolas Madelaine 2025-11-26 23:03:23 +01:00
parent 9a74ac0123
commit 85c7c8eb52
3 changed files with 184 additions and 147 deletions

View file

@ -67,9 +67,9 @@ impl<'l> Move<'l> {
/// Returns `true` if the move is a capture.
#[inline]
pub fn is_capture(self) -> bool {
let setup = self.position.as_setup();
let [p_b_q, n_b_k, r_q_k, _] = self.position.as_setup().bitboards;
self.raw.kind == MoveType::EnPassant
|| !((setup.p_b_q | setup.n_b_k | setup.r_q_k) & self.to().bitboard()).is_empty()
|| !((p_b_q | n_b_k | r_q_k) & self.to().bitboard()).is_empty()
}
/// Returns the type of piece that is captured, if the move is a capture.