Add function to flip board.

This commit is contained in:
Marco 2022-12-13 03:35:01 +01:00
parent 4a0e57902c
commit 3889245c8a

View File

@ -49,7 +49,7 @@ class ChessBloc extends Bloc<ChessEvent, ChessBoardState> {
} }
class ChessBoardState { class ChessBoardState {
final bool flipped; late bool flipped;
final ChessColor turnColor; final ChessColor turnColor;
final Map<ChessCoordinate, ChessPiece> position; final Map<ChessCoordinate, ChessPiece> position;
@ -111,4 +111,8 @@ class ChessBoardState {
return ChessBoardState._(flipped, turnColor, position); return ChessBoardState._(flipped, turnColor, position);
} }
void flipBoard() {
flipped = !flipped;
}
} }