Provide toString() for ChessCoordinate class.

This commit is contained in:
Marco 2022-11-13 14:28:09 +01:00
parent aa3e3187c4
commit ce63a3e483

View File

@ -37,8 +37,8 @@ Map<ChessPieceName, String> chessPiecesAssets = {
};
class ChessCoordinate {
late int column;
late int row;
final int column;
final int row;
ChessCoordinate(this.column, this.row);
@ -60,6 +60,14 @@ class ChessCoordinate {
return colInt;
}
@override
String toString() {
String row = this.row.toString();
String col = this.column.toString();
return '$col$row';
}
@override
operator ==(other) {
return other is ChessCoordinate &&