[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:
parent
3b40aacd52
commit
3ecc263701
4 changed files with 184 additions and 0 deletions
|
@ -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)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue