Add 'Bitboard::is_empty'

This commit is contained in:
Bruno BELANYI 2022-07-18 00:31:33 +02:00
parent 0dde0d5dbd
commit 057b383f8c

View file

@ -49,6 +49,12 @@ impl Bitboard {
pub fn count(self) -> u32 {
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 {