[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
|
@ -187,7 +187,7 @@ fn respond(line: &str, state: &mut State) -> anyhow::Result<CommandResult> {
|
|||
}
|
||||
|
||||
fn do_flags_command(state: &mut State, _matches: &clap::ArgMatches) -> CommandResult {
|
||||
let board = &state.position.board;
|
||||
let board = state.position.board();
|
||||
|
||||
println!("Castling:");
|
||||
|
||||
|
@ -390,7 +390,7 @@ fn main() -> Result<(), String> {
|
|||
loop {
|
||||
if should_print_position {
|
||||
println!("{}", &state.position);
|
||||
println!("{} to move.", state.position.board.active_color());
|
||||
println!("{} to move.", state.position.active_color());
|
||||
}
|
||||
|
||||
let readline = editor.readline("\n? ");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue