[board] Implement PieceSet::iter() as an iterator over its Mailbox

This commit is contained in:
Eryn Wells 2024-07-13 11:53:16 -07:00
parent fff2e084b5
commit a14cb30781

View file

@ -75,6 +75,10 @@ impl PieceSet {
self.by_color.bitboard(color)
}
pub(crate) fn iter(&self) -> impl Iterator<Item = PlacedPiece> {
self.mailbox.iter()
}
pub(super) fn bitboard_for_color(&self, color: Color) -> BitBoard {
self.by_color.bitboard(color)
}