[board] Replace Flags with castle::Rights
This commit is contained in:
parent
cd60a453aa
commit
bb8d5a6aa3
3 changed files with 62 additions and 19 deletions
|
@ -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 "";
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue