[position] Implement a SliderRayToSquare trait
This trait declares ray_to_square() which should return a BitBoard representing a ray from a Square to another Square. The ray should include the target Square. PlacedPiece implements this trait.
This commit is contained in:
parent
cac13b4bc7
commit
722a90b860
3 changed files with 141 additions and 7 deletions
|
@ -220,8 +220,8 @@ impl MoveLibrary {
|
|||
ray
|
||||
}
|
||||
|
||||
pub(super) fn ray(&self, sq: Square, dir: Direction) -> BitBoard {
|
||||
self.rays[sq as usize][dir as usize]
|
||||
pub(super) fn ray(&self, sq: Square, dir: Direction) -> &BitBoard {
|
||||
&self.rays[sq as usize][dir as usize]
|
||||
}
|
||||
|
||||
pub(super) fn pawn_pushes(&self, sq: Square, color: Color) -> BitBoard {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue