[board] Remove BoardSide enum; use Castle everywhere
Move Castle to a castle module inside the move module. Implement into_index() on Castle to turn it into a usize.
This commit is contained in:
parent
21b5266789
commit
fa1c6b452e
8 changed files with 95 additions and 63 deletions
|
@ -176,12 +176,14 @@ impl<'p> Builder<'p, ValidatedMove> {
|
|||
} => {
|
||||
let mut pieces = self.position.piece_bitboards().clone();
|
||||
|
||||
let target_squares = castle.target_squares(player);
|
||||
|
||||
let king_from: BitBoard = king.square().into();
|
||||
let king_to: BitBoard = Square::king_castle_target(player, castle).into();
|
||||
let king_to: BitBoard = target_squares.king.into();
|
||||
*pieces.bitboard_for_piece_mut(king.piece()) ^= king_from | king_to;
|
||||
|
||||
let rook_from: BitBoard = rook.square().into();
|
||||
let rook_to: BitBoard = Square::rook_castle_target(player, castle).into();
|
||||
let rook_to: BitBoard = target_squares.rook.into();
|
||||
*pieces.bitboard_for_piece_mut(rook.piece()) ^= rook_from | rook_to;
|
||||
|
||||
*pieces.bitboard_for_color_mut(player) &=
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue