Do not convert short piece name to lower case.
This commit is contained in:
parent
105b6e7565
commit
f2a4893b6f
@ -26,6 +26,6 @@ subprojects {
|
||||
project.evaluationDependsOn(':app')
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
tasks.register("clean", Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
|
@ -35,8 +35,11 @@ class ChessBoard extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
log("ChessBoard's build()");
|
||||
|
||||
return Column(
|
||||
children: _buildBoard(bState.bottomColor == ChessColor.black));
|
||||
return Container(
|
||||
decoration: const BoxDecoration(
|
||||
boxShadow: [BoxShadow(color: Colors.black, offset: Offset(10, 10))]),
|
||||
child: _buildBoard(bState.bottomColor == ChessColor.black),
|
||||
);
|
||||
}
|
||||
|
||||
Row _buildChessRow(int rowNo, bool flipped) {
|
||||
@ -56,7 +59,7 @@ class ChessBoard extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
List<Row> _buildBoard(bool flipped) {
|
||||
Column _buildBoard(bool flipped) {
|
||||
List<Row> chessBoard = <Row>[];
|
||||
|
||||
if (!flipped) {
|
||||
@ -69,7 +72,7 @@ class ChessBoard extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
return chessBoard;
|
||||
return Column(children: [...chessBoard]);
|
||||
}
|
||||
|
||||
ChessSquare getSquareAtCoordinate(ChessCoordinate coord) {
|
||||
|
@ -112,13 +112,13 @@ class ChessBloc extends Bloc<ChessEvent, ChessBoardState> {
|
||||
var pieceAtStartSquare = ChessPosition.getInstance().getPieceAt(
|
||||
ChessCoordinate(event.startSquare.column, event.startSquare.row));
|
||||
if (pieceAtStartSquare == null) {
|
||||
log('received a promotion but piece on start square was empty');
|
||||
log('received a promotion but start square was empty');
|
||||
return;
|
||||
}
|
||||
|
||||
ChessPieceClass pieceClass = ChessPieceClass.none;
|
||||
for (var piece in chessPiecesShortName.entries) {
|
||||
if (piece.value.toLowerCase() == event.piece) {
|
||||
if (piece.value == event.piece) {
|
||||
pieceClass = piece.key.pieceClass;
|
||||
break;
|
||||
}
|
||||
@ -169,8 +169,7 @@ class ChessBloc extends Bloc<ChessEvent, ChessBoardState> {
|
||||
OwnPromotionPlayed event, Emitter<ChessBoardState> emit) {
|
||||
var apiMove = event.move.toApiMove();
|
||||
var shorNameForPiece = chessPiecesShortName[
|
||||
ChessPieceAssetKey(pieceClass: event.pieceClass, color: myColor!)]!
|
||||
.toLowerCase();
|
||||
ChessPieceAssetKey(pieceClass: event.pieceClass, color: myColor!)]!;
|
||||
apiMove.promotionToPiece = shorNameForPiece;
|
||||
var message = ApiWebsocketMessage(
|
||||
type: MessageType.move,
|
||||
|
Loading…
Reference in New Issue
Block a user