[explorer] Print some question marks if a move is generated without target/origin squares

The move I observed in my testing was a castling move, which doesn't set target
and origin squares because those are provided by the castling parameters struct
from the board crate.

Fix the missing squares on castle moves by looking up castling parameters and
populating them. This requires Move::castle() to take a Color in addition to the
Wing. Update all the call sites.
This commit is contained in:
Eryn Wells 2025-06-11 08:15:06 -07:00
parent 659ffb6130
commit 9815a63ebb
6 changed files with 27 additions and 16 deletions

View file

@ -82,7 +82,7 @@ impl Parameters {
];
#[must_use]
pub fn get(color: Color, wing: Wing) -> &'static Parameters {
pub const fn get(color: Color, wing: Wing) -> &'static Parameters {
&Self::BY_COLOR[color as usize][wing as usize]
}
}