Fix bug that did not change the move color when a promotion was received.

This commit is contained in:
Marco 2023-07-06 00:12:03 +02:00
parent 95fba78d0c
commit 4b8624f82b

View File

@ -129,6 +129,10 @@ class ChessBloc extends Bloc<ChessEvent, ChessBoardState> {
newPosition[ChessCoordinate(event.endSquare.column, event.endSquare.row)] = newPosition[ChessCoordinate(event.endSquare.column, event.endSquare.row)] =
ChessPiece(pieceClass, pieceAtStartSquare.color); ChessPiece(pieceClass, pieceAtStartSquare.color);
turnColor = state.newTurnColor == ChessColor.white
? ChessColor.black
: ChessColor.white;
emit(ChessBoardState( emit(ChessBoardState(
state.bottomColor, state.bottomColor,
turnColor, turnColor,