Add 'Bitboard::is_empty'

This commit is contained in:
Bruno BELANYI 2022-07-18 00:31:33 +02:00
parent 9ef600c1bb
commit f66b0276d8

View file

@ -49,6 +49,12 @@ impl Bitboard {
pub fn count(self) -> u32 { pub fn count(self) -> u32 {
self.0.count_ones() self.0.count_ones()
} }
/// Return true if there are no pieces in the [Bitboard], otherwise false.
#[inline(always)]
pub fn is_empty(self) -> bool {
self == Self::EMPTY
}
} }
impl Default for Bitboard { impl Default for Bitboard {