[board, position] Simplify check methods

Only one check-testing method, Board::is_in_check(), that tests if the current
active player is in check. It doesn't make sense to test if the non-active player
is in check.
This commit is contained in:
Eryn Wells 2025-06-29 09:25:08 -07:00
parent a30553503f
commit e3d17219ad
3 changed files with 9 additions and 17 deletions

View file

@ -129,7 +129,7 @@ impl Position {
);
});
let move_is_legal = !test_board.color_is_in_check(Some(active_color_before_move));
let move_is_legal = !test_board.is_in_check();
test_board.unmake_move(&record).unwrap_or_else(|err| {
panic!(