Get en passant move building working (again?)
This commit is contained in:
parent
5d1ad73be6
commit
047eb4fd77
3 changed files with 28 additions and 16 deletions
|
@ -270,14 +270,19 @@ impl Builder<Push> {
|
|||
}
|
||||
|
||||
pub fn capturing_en_passant_on(self, square: Square) -> Builder<EnPassantCapture> {
|
||||
let mut style = self.style;
|
||||
style.to = Some(square);
|
||||
match EnPassant::from_target_square(square) {
|
||||
Some(en_passant) => {
|
||||
let mut style = self.style;
|
||||
style.to = Some(en_passant.target_square());
|
||||
|
||||
Builder {
|
||||
style: EnPassantCapture {
|
||||
push: self.style,
|
||||
capture: Some(square),
|
||||
},
|
||||
Builder {
|
||||
style: EnPassantCapture {
|
||||
push: style,
|
||||
capture: Some(en_passant.capture_square()),
|
||||
},
|
||||
}
|
||||
}
|
||||
None => todo!(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue