[moves] Implement promotions and en passant in the PawnMoveGenerator
Add another sub-iterator to the PawnMoveGenerator that produces promotion pushes or capture moves (depending on move_type) when a pawn moves to the back rank. Also implement en passant moves. Fix a bug in the Left and Right captures branches where the wrong neighbors used to calculate origin squares. Add a whole bunch of tests. Still missing several cases though.
This commit is contained in:
parent
ab587f379f
commit
09bf17d66b
4 changed files with 305 additions and 14 deletions
|
@ -6,7 +6,13 @@ pub use pawn::PawnMoveGenerator;
|
|||
|
||||
use crate::Move;
|
||||
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
|
||||
pub struct GeneratedMove {
|
||||
pub(crate) ply: Move,
|
||||
}
|
||||
|
||||
impl From<Move> for GeneratedMove {
|
||||
fn from(value: Move) -> Self {
|
||||
GeneratedMove { ply: value }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue