[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:
Eryn Wells 2025-06-21 21:07:26 -07:00
parent 4ae1fd62b7
commit f84319272c
3 changed files with 12 additions and 7 deletions

View file

@ -8,7 +8,7 @@
use chessfriend_core::Color;
use chessfriend_moves::{
assert_move_list, assert_move_list_contains, assert_move_list_does_not_contain, ply, Move,
Move, assert_move_list, assert_move_list_contains, assert_move_list_does_not_contain, ply,
};
use chessfriend_position::test_position;
use std::collections::HashSet;
@ -107,7 +107,7 @@ fn en_passant_check_capture() {
White Pawn on D4,
], D3);
assert!(pos.board.active_color_is_in_check());
assert!(pos.board().active_color_is_in_check());
let generated_moves: HashSet<_> = pos.all_legal_moves(Some(Color::Black)).collect();
@ -123,7 +123,7 @@ fn en_passant_check_block() {
White Queen on F1,
], D3);
assert!(pos.board.active_color_is_in_check());
assert!(pos.board().active_color_is_in_check());
let generated_moves: HashSet<_> = pos.all_legal_moves(Some(Color::Black)).collect();
@ -139,7 +139,7 @@ fn pinned_pieces_rook_cannot_move_out_of_pin() {
White King on C1,
]);
assert!(!pos.board.active_color_is_in_check());
assert!(!pos.board().active_color_is_in_check());
let rook_moves: HashSet<_> = pos.all_legal_moves(None).collect();