[board] Add occupancy methods that return BitBoards
This commit is contained in:
parent
9943224ee0
commit
3b5b2f16a3
2 changed files with 37 additions and 8 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue