[position] Derive several traits for CheckingPieces

Clone, Debug, Eq, and PartialEq.
This commit is contained in:
Eryn Wells 2024-02-04 19:26:41 -08:00
parent 17410936ab
commit 4b35051deb

View file

@ -5,6 +5,7 @@ use chessfriend_core::{Color, Direction, Shape, Square};
use crate::sight::SliderRayToSquareExt;
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct CheckingPieces {
bitboards: [BitBoard; 5],
}
@ -23,7 +24,7 @@ impl CheckingPieces {
}
pub fn count(&self) -> u32 {
self.bitboards.iter().map(|b| b.population_count()).sum()
self.bitboards.iter().map(BitBoard::population_count).sum()
}
/// A BitBoard representing the set of pieces that must be captured to