diff --git a/board/src/board.rs b/board/src/board.rs index 84b2700..966d611 100644 --- a/board/src/board.rs +++ b/board/src/board.rs @@ -63,6 +63,10 @@ impl Board { self.pieces.get(square) } + pub fn find_pieces(&self, piece: Piece) -> BitBoard { + self.pieces.find_pieces(piece) + } + /// Place a piece on the board. /// /// ## Errors @@ -102,6 +106,15 @@ impl Board { pub fn opposing_occupancy(&self, color: Color) -> BitBoard { self.pieces.opposing_occupancy(color) } + + pub fn enemies(&self, color: Color) -> BitBoard { + self.pieces.opposing_occupancy(color) + } + + /// Return a [`BitBoard`] of all pawns of a given color. + pub fn pawns(&self, color: Color) -> BitBoard { + self.pieces.find_pieces(Piece::pawn(color)) + } } impl Board {