[bitboard, board] Make BitBoard::EMPTY and BitBoard::FULL public
Deprecate the methods.
I think I'm undoing a change I made earlier. 🙃
This commit is contained in:
parent
8db533cb52
commit
e7fd65672d
4 changed files with 9 additions and 7 deletions
|
@ -43,13 +43,15 @@ macro_rules! moves_getter {
|
|||
}
|
||||
|
||||
impl BitBoard {
|
||||
const EMPTY: BitBoard = BitBoard(u64::MIN);
|
||||
const FULL: BitBoard = BitBoard(u64::MAX);
|
||||
pub const EMPTY: BitBoard = BitBoard(u64::MIN);
|
||||
pub const FULL: BitBoard = BitBoard(u64::MAX);
|
||||
|
||||
#[deprecated(note = "Use BitBoard::EMPTY instead")]
|
||||
pub const fn empty() -> BitBoard {
|
||||
Self::EMPTY
|
||||
}
|
||||
|
||||
#[deprecated(note = "Use BitBoard::FULL instead")]
|
||||
pub const fn full() -> BitBoard {
|
||||
Self::FULL
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ pub use direction::IterationDirection;
|
|||
macro_rules! bitboard {
|
||||
($($sq:ident)* $(,)?) => {
|
||||
{
|
||||
let mut bitboard = $crate::BitBoard::empty();
|
||||
let mut bitboard = $crate::BitBoard::EMPTY;
|
||||
$(bitboard.set(chessfriend_core::Square::$sq);)*
|
||||
bitboard
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ impl Board {
|
|||
if let Some(piece) = self.get_piece(square) {
|
||||
piece.movement(square, self)
|
||||
} else {
|
||||
BitBoard::empty()
|
||||
BitBoard::EMPTY
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ impl Board {
|
|||
if let Some(piece) = self.get_piece(square) {
|
||||
piece.sight(square, self)
|
||||
} else {
|
||||
BitBoard::empty()
|
||||
BitBoard::EMPTY
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,7 @@ impl Board {
|
|||
self.friendly_occupancy(color)
|
||||
.occupied_squares(&IterationDirection::default())
|
||||
.map(|square| self.sight(square))
|
||||
.fold(BitBoard::empty(), BitOr::bitor)
|
||||
.fold(BitBoard::EMPTY, BitOr::bitor)
|
||||
}
|
||||
|
||||
pub fn active_color_opposing_sight(&self) -> BitBoard {
|
||||
|
@ -60,7 +60,7 @@ impl Board {
|
|||
Some(self.friendly_sight(c))
|
||||
}
|
||||
})
|
||||
.fold(BitBoard::empty(), BitOr::bitor)
|
||||
.fold(BitBoard::EMPTY, BitOr::bitor)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue