Provide toString() for ChessCoordinate class.
This commit is contained in:
parent
aa3e3187c4
commit
ce63a3e483
@ -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 &&
|
||||
|
Loading…
Reference in New Issue
Block a user