diff --git a/board/src/piece_sets.rs b/board/src/piece_sets.rs index bb6d712..063937d 100644 --- a/board/src/piece_sets.rs +++ b/board/src/piece_sets.rs @@ -138,18 +138,6 @@ impl PieceSet { } } -impl PieceSet { - pub fn color_bitboard(&self, color: Color) -> BitBoard { - self.color_occupancy[color as usize] - } - - pub fn piece_bitboard(&self, piece: Piece) -> BitBoard { - let color_occupancy = self.color_occupancy[piece.color as usize]; - let shape_occupancy = self.shape_occupancy[piece.shape as usize]; - color_occupancy & shape_occupancy - } -} - impl Hash for PieceSet { fn hash(&self, state: &mut H) { self.color_occupancy.hash(state); @@ -163,32 +151,3 @@ impl PartialEq for PieceSet { && self.shape_occupancy == other.shape_occupancy } } - -#[cfg(test)] -mod tests { - use super::*; - use chessfriend_bitboard::bitboard; - - #[test] - fn place_piece() -> Result<(), PlacePieceError> { - let mut pieces = PieceSet::default(); - - pieces.place( - Piece::king(Color::White), - Square::F5, - PlacePieceStrategy::default(), - )?; - - assert_eq!( - pieces.mailbox.get(Square::F5), - Some(Piece::king(Color::White)) - ); - assert_eq!(pieces.color_bitboard(Color::White), bitboard![F5]); - assert_eq!( - pieces.piece_bitboard(Piece::king(Color::White)), - bitboard![F5] - ); - - Ok(()) - } -}