List of Captured/Promoted Pieces #71
Replies: 1 comment
-
No there's no built in method currently, but I can add one. Yeah, traversing backwards through states will work, but only for cases where the entire game is tracked. Maybe a better way would be to calculate from a provided starting position. Probably what I'll do is give a state.missingPieces({String? startPosition}), where if no start position is provided, it takes the first state. And I'll make it clear in the return value what the starting position used was. I don't know if promotion adds any complications here, but just so you know, the pieces on the board do have a flag encoded into them which contains their original piece type, and thus whether they were promoted. It's called I'm going to be doing some small bishop things this weekend so I'll take a look. |
Beta Was this translation helpful? Give feedback.
-
Is there a built-in method to get a list of already captured/promoted pieces in the chess game for both sides? I guess not, I would then try to back it out from the following bishop state:
/// A list of pieces each player has.
final List pieces;
Essentially, I want to add a small display which player is ahead by which pieces and which piece value.
Thank you in advance and best wishes
Beta Was this translation helpful? Give feedback.
All reactions