[board, position] Add a color argument to opposing_sight
New convention: active_color_ methods operate on the active color of the Board. Methods without that prefix take a color parameter and operate on that. Refactor opposing_sight to do this.
This commit is contained in:
parent
a92ec9aba3
commit
0abe9b6c19
3 changed files with 10 additions and 7 deletions
|
@ -61,7 +61,7 @@ impl Board {
|
|||
}
|
||||
|
||||
// King cannot pass through check.
|
||||
let opposing_sight = self.opposing_sight();
|
||||
let opposing_sight = self.opposing_sight(active_color);
|
||||
let opposing_pieces_can_see_castling_path =
|
||||
(parameters.check & opposing_sight).is_populated();
|
||||
if opposing_pieces_can_see_castling_path {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue