syncing between desktops
This commit is contained in:
parent
1f61dc35f8
commit
628b9fcc42
1 changed files with 12 additions and 4 deletions
16
src/board.rs
16
src/board.rs
|
|
@ -313,16 +313,24 @@ impl Board {
|
||||||
println!("============================================\n");
|
println!("============================================\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn make_move(&mut self, mv: Move) {
|
pub fn make_move(&mut self, mv: Move) -> UndoMove {
|
||||||
let from = mv.value()& MOVE_FROM_MASK;
|
let from = mv.value()& MOVE_FROM_MASK;
|
||||||
let to = mv.value() & MOVE_TO_MASK;
|
let to = mv.value() & MOVE_TO_MASK;
|
||||||
let flag = mv.value() & MOVE_FLAG_MASK;
|
let flag = mv.value() & MOVE_FLAG_MASK;
|
||||||
|
|
||||||
// promo must come first because of double usage of the flag bits
|
//// TODO keep going here actually make the move on the board <<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
||||||
if flag & MOVE_FLAG_CAPTURE > 0 {
|
if flag & MOVE_FLAG_CAPTURE > 0 {
|
||||||
|
return UndoMove::new(mv,
|
||||||
|
Some(PieceType::Pawn), // PLACEHOLDER!!!!!!!!!!!!!!!!!!!!
|
||||||
|
self.en_passant_target,
|
||||||
|
self.castling_rights,
|
||||||
|
self.halfmove_clock);
|
||||||
} else { // No capture
|
} else { // No capture
|
||||||
|
return UndoMove::new(mv,
|
||||||
|
None,
|
||||||
|
self.en_passant_target,
|
||||||
|
self.castling_rights,
|
||||||
|
self.halfmove_clock);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue