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 { class ChessCoordinate {
late int column; final int column;
late int row; final int row;
ChessCoordinate(this.column, this.row); ChessCoordinate(this.column, this.row);
@ -60,6 +60,14 @@ class ChessCoordinate {
return colInt; return colInt;
} }
@override
String toString() {
String row = this.row.toString();
String col = this.column.toString();
return '$col$row';
}
@override @override
operator ==(other) { operator ==(other) {
return other is ChessCoordinate && return other is ChessCoordinate &&