tests + ado equals override

This commit is contained in:
Janet-Doe
2025-04-16 10:55:27 +02:00
parent 3f06a9eb17
commit 076288a400
9 changed files with 89 additions and 4 deletions

View File

@@ -301,4 +301,11 @@ public class ChessBoard {
this.lastMove = lastMove;
}
@Override
public boolean equals(Object otherBoard){
if (!(otherBoard instanceof ChessBoard)) return false;
return ((hashPlayerPieces(Color.White) == ((ChessBoard)otherBoard).hashPlayerPieces(Color.White))
&& (hashPlayerPieces(Color.Black) == ((ChessBoard)otherBoard).hashPlayerPieces(Color.Black)));
}
}