[board] Refactor ray BitBoard lookups

Rearrange the generated ray bitboards into a 2D grid by square and direction.
Use the Direction vector for lookup.
This commit is contained in:
Eryn Wells 2024-01-06 19:47:55 -08:00
parent 2394afc210
commit 6e483b412b
2 changed files with 47 additions and 76 deletions

View file

@ -36,6 +36,10 @@ impl BitBoard {
FILES[file]
}
pub fn ray(sq: Square, dir: Direction) -> BitBoard {
library().ray(sq, dir)
}
moves_getter!(knight_moves);
moves_getter!(bishop_moves);
moves_getter!(rook_moves);