[board] Add occupancy methods that return BitBoards

This commit is contained in:
Eryn Wells 2025-05-16 07:47:28 -07:00
parent 9943224ee0
commit 3b5b2f16a3
2 changed files with 37 additions and 8 deletions

View file

@ -82,7 +82,24 @@ impl Board {
}
impl Board {
#[must_use]
pub fn occupancy(&self) -> BitBoard {
self.pieces.occpuancy()
}
pub fn vacancy(&self) -> BitBoard {
!self.occupancy()
}
pub fn friendly_occupancy(&self, color: Color) -> BitBoard {
self.pieces.friendly_occupancy(color)
}
pub fn opposing_occupancy(&self, color: Color) -> BitBoard {
self.pieces.opposing_occupancy(color)
}
}
impl Board {
pub fn display(&self) -> DiagramFormatter<'_> {
DiagramFormatter::new(self)
}