[board] Make Board::pieces private
Do not allow direct access to the internal piece set. Update call sites to use Board API instead.
This commit is contained in:
parent
6d0df32f74
commit
09fbe1be22
3 changed files with 3 additions and 3 deletions
|
@ -15,7 +15,7 @@ pub type FullMoveClock = u32;
|
|||
#[derive(Clone, Debug, Default, Eq, PartialEq)]
|
||||
pub struct Board {
|
||||
pub active_color: Color,
|
||||
pub pieces: PieceSet,
|
||||
pieces: PieceSet,
|
||||
pub castling_rights: castle::Rights,
|
||||
pub en_passant_target: Option<Square>,
|
||||
pub half_move_clock: HalfMoveClock,
|
||||
|
|
|
@ -23,7 +23,7 @@ impl Board {
|
|||
}
|
||||
|
||||
fn king_bitboard(&self, color: Color) -> BitBoard {
|
||||
self.pieces.find_pieces(Piece::king(color))
|
||||
self.find_pieces(Piece::king(color))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -209,7 +209,7 @@ impl FromFenStr for Board {
|
|||
let file = files.next().ok_or(FromFenStrError::MissingPlacement)?;
|
||||
let piece = Piece::from_fen_str(&ch.to_string())?;
|
||||
|
||||
let _ = board.pieces.place(
|
||||
let _ = board.place_piece(
|
||||
piece,
|
||||
Square::from_file_rank(*file, *rank),
|
||||
PlacePieceStrategy::default(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue