[bitboard] Make the bitboard crate more crate-like
Export symbols needed to use BitBoard and BitBoardBuilder. Fix build errors.
This commit is contained in:
parent
d901be53d2
commit
3cec64d686
4 changed files with 9 additions and 8 deletions
|
@ -7,7 +7,7 @@ use std::fmt;
|
|||
use std::ops::Not;
|
||||
|
||||
#[derive(Clone, Copy, Eq, Hash, PartialEq)]
|
||||
pub(crate) struct BitBoard(pub(super) u64);
|
||||
pub struct BitBoard(pub(crate) u64);
|
||||
|
||||
macro_rules! moves_getter {
|
||||
($getter_name:ident) => {
|
||||
|
@ -71,13 +71,13 @@ impl BitBoard {
|
|||
impl BitBoard {
|
||||
/// Return an Iterator over the occupied squares, starting from the leading
|
||||
/// (most-significant bit) end of the field.
|
||||
pub(crate) fn occupied_squares(&self) -> impl Iterator<Item = Square> {
|
||||
pub fn occupied_squares(&self) -> impl Iterator<Item = Square> {
|
||||
LeadingBitScanner::new(self.0).map(|idx| unsafe { Square::from_index(idx as u8) })
|
||||
}
|
||||
|
||||
/// Return an Iterator over the occupied squares, starting from the trailing
|
||||
/// (least-significant bit) end of the field.
|
||||
pub(crate) fn occupied_squares_trailing(&self) -> impl Iterator<Item = Square> {
|
||||
pub fn occupied_squares_trailing(&self) -> impl Iterator<Item = Square> {
|
||||
LeadingBitScanner::new(self.0).map(|idx| unsafe { Square::from_index(idx as u8) })
|
||||
}
|
||||
}
|
||||
|
@ -244,7 +244,7 @@ impl BitBoardBuilder {
|
|||
mod tests {
|
||||
use super::*;
|
||||
use crate::bitboard;
|
||||
use chess_core::Square;
|
||||
use chessfriend_core::Square;
|
||||
|
||||
#[test]
|
||||
fn display_and_debug() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue