Add 'Bitboard::is_empty'
This commit is contained in:
parent
9ef600c1bb
commit
f66b0276d8
1 changed files with 6 additions and 0 deletions
|
|
@ -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 {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue