tests + ado equals override
This commit is contained in:
@@ -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)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user