[moves] Implement AllPiecesMoveGenerator

A generator that yields moves for all pieces on the board. This generator combines
the shape-specific move generators developed in prior commits into a single
iterator that yields all moves.

Implement FusedIterator for all generators so AllPiecesMoveGenerator can avoid
doing a bunch of extra work once each iterator has yielded None.
This commit is contained in:
Eryn Wells 2025-05-28 16:22:16 -07:00
parent 19c6c6701a
commit 2106e05d57
6 changed files with 85 additions and 3 deletions

View file

@ -1,5 +1,6 @@
// Eryn Wells <eryn@erynwells.me>
mod all;
mod king;
mod knight;
mod pawn;
@ -8,6 +9,7 @@ mod slider;
#[cfg(test)]
mod testing;
pub use all::AllPiecesMoveGenerator;
pub use king::KingMoveGenerator;
pub use knight::KnightMoveGenerator;
pub use pawn::PawnMoveGenerator;