[board] Replace Flags with castle::Rights

This commit is contained in:
Eryn Wells 2025-05-02 15:41:45 -07:00
parent cd60a453aa
commit bb8d5a6aa3
3 changed files with 62 additions and 19 deletions

View file

@ -103,8 +103,10 @@ impl ToFenStr for Board {
(Color::Black, Castle::QueenSide),
]
.map(|(color, castle)| {
let can_castle = self.player_has_right_to_castle(color, castle);
if !can_castle {
if !self
.castling_rights
.player_has_right_to_castle(color, castle)
{
return "";
}