[board] Implement PieceSet::mailbox() method to return a reference to its Mailbox

This commit is contained in:
Eryn Wells 2025-05-02 15:05:39 -07:00
parent bf535f876a
commit 58cbe07136

View file

@ -30,9 +30,9 @@ impl Default for PlacePieceStrategy {
/// placement of pieces on the board.
#[derive(Clone, Debug, Default, Eq, Hash, PartialEq)]
pub(crate) struct PieceSet {
mailbox: Mailbox,
by_color: ByColor,
by_color_and_shape: ByColorAndShape,
mailbox: Mailbox,
}
impl PieceSet {
@ -65,6 +65,10 @@ impl PieceSet {
}
}
pub(crate) fn mailbox(&self) -> &Mailbox {
&self.mailbox
}
/// A [`BitBoard`] representing all the pieces currently on the board. Other
/// engines might refer to this concept as 'occupancy'.
pub(crate) fn all_pieces(&self) -> BitBoard {