Add 'copy-on-make' 'ChessBoard::play_move'
This commit is contained in:
parent
29e50a65dc
commit
b913f4673a
|
@ -132,6 +132,14 @@ impl ChessBoard {
|
|||
self.combined_occupancy ^= start_end;
|
||||
}
|
||||
|
||||
/// Play the given [Move], return a copy of the board with the resulting state.
|
||||
#[inline(always)]
|
||||
pub fn play_move(&self, chess_move: Move) -> Self {
|
||||
let mut res = self.clone();
|
||||
res.play_move_inplace(chess_move);
|
||||
res
|
||||
}
|
||||
|
||||
/// Play the given [Move] in place, returning all non-revertible state (e.g: en-passant,
|
||||
/// etc...).
|
||||
#[inline(always)]
|
||||
|
|
Loading…
Reference in a new issue