[explorer, position] Make Position.board private to the crate
Export a Position::board() method that returns a reference to the internal Board.
This commit is contained in:
parent
4ae1fd62b7
commit
f84319272c
3 changed files with 12 additions and 7 deletions
|
|
@ -24,7 +24,7 @@ use std::{collections::HashSet, fmt, sync::Arc};
|
|||
#[must_use]
|
||||
#[derive(Clone, Debug, Default, Eq)]
|
||||
pub struct Position {
|
||||
pub board: Board,
|
||||
pub(crate) board: Board,
|
||||
pub(crate) moves: Vec<MoveRecord>,
|
||||
pub(crate) captures: CapturesList,
|
||||
|
||||
|
|
@ -48,6 +48,11 @@ impl Position {
|
|||
..Default::default()
|
||||
}
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn board(&self) -> &Board {
|
||||
&self.board
|
||||
}
|
||||
}
|
||||
|
||||
impl Position {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue