[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:
parent
2394afc210
commit
6e483b412b
2 changed files with 47 additions and 76 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue