[board] Implement piece sight algorithms

Add a new Sight trait, implemented by PlacedPiece. The implementation of this
trait produces a BitBoard representing the squares visible to the placed piece.
This commit is contained in:
Eryn Wells 2024-01-15 16:03:06 -08:00
parent 3b40aacd52
commit 3ecc263701
4 changed files with 184 additions and 0 deletions

View file

@ -238,6 +238,16 @@ impl PlacedPiece {
pub fn square(&self) -> Square {
self.square
}
#[inline]
pub fn color(&self) -> Color {
self.piece.color
}
#[inline]
pub fn shape(&self) -> Shape {
self.piece.shape
}
}
#[cfg(test)]