board backing referencing improvements

This commit is contained in:
2025-03-10 21:48:31 -04:00
parent 54f7b8e472
commit 69dc686d0a
3 changed files with 65 additions and 38 deletions

View File

@@ -5,7 +5,6 @@ use super::{
};
use static_assertions::const_assert;
#[cfg(not(feature = "bitvec"))]
pub type BitBoardInner = u64;
#[derive(Copy, Clone, PartialEq, Eq)]
@@ -42,6 +41,10 @@ impl BitBoard {
self.0.count_ones() as usize
}
pub const fn is_empty(&self) -> bool {
self.0 == 0
}
// Directional shifts with edge masking (prevents wrapping)
pub const fn east(&self) -> Self {
let mask = !Self::col_mask(Board::BOARD_SIZE - 1).0; // Mask to block column 7 bits