added method to get the current square of a king

This commit is contained in:
Varga Dávid Lajos
2025-11-15 10:14:37 +01:00
parent 5854dbc20b
commit 274ffcf5ec

View File

@@ -86,6 +86,10 @@ impl Board {
return self.side_to_move;
}
#[inline(always)]
pub fn current_king_square(&self) -> u32 {
return if self.side_to_move == 0 { self.bitboards[5].trailing_zeros() } else { self.bitboards[11].trailing_zeros() };
}
fn calc_occupancy(&mut self) {
self.occupancy = [0u64; 3];