[board] Make the MoveSet struct (and its internal structs) public for the crate
This commit is contained in:
parent
3244bfc211
commit
90266f2dd0
2 changed files with 11 additions and 3 deletions
|
@ -10,8 +10,7 @@ mod queen;
|
|||
mod rook;
|
||||
|
||||
pub use move_generator::Moves;
|
||||
|
||||
pub(self) use move_set::MoveSet;
|
||||
pub(crate) use move_set::MoveSet;
|
||||
|
||||
use crate::{
|
||||
piece::{Color, Piece, PlacedPiece},
|
||||
|
|
|
@ -1,17 +1,26 @@
|
|||
use crate::{piece::PlacedPiece, BitBoard, Move};
|
||||
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
struct BitBoardSet {
|
||||
quiet: BitBoard,
|
||||
captures: BitBoard,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
struct MoveListSet {
|
||||
quiet: Vec<Move>,
|
||||
captures: Vec<Move>,
|
||||
}
|
||||
|
||||
impl MoveListSet {
|
||||
pub fn contains(&self, mv: &Move) -> bool {
|
||||
self.quiet.contains(mv) || self.captures.contains(mv)
|
||||
}
|
||||
}
|
||||
|
||||
/// A set of moves for a piece on the board.
|
||||
pub(super) struct MoveSet {
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub(crate) struct MoveSet {
|
||||
piece: PlacedPiece,
|
||||
bitboards: BitBoardSet,
|
||||
move_lists: MoveListSet,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue