This commit is contained in:
Janet-Doe
2025-04-16 11:01:16 +02:00
parent 076288a400
commit ebb013cae5
6 changed files with 7 additions and 13 deletions

View File

@@ -20,8 +20,7 @@ public class Bishop extends Piece {
return 0; return 0;
} }
@Override public boolean equals(Object obj) {
public boolean equals(Piece obj) {
return (obj instanceof Bishop && ((Bishop) obj).getColor() == this.getColor()); return (obj instanceof Bishop && ((Bishop) obj).getColor() == this.getColor());
} }

View File

@@ -20,8 +20,7 @@ public class King extends Piece {
return 1; return 1;
} }
@Override public boolean equals(Object obj) {
public boolean equals(Piece obj) {
return (obj instanceof King && ((King) obj).getColor() == this.getColor()); return (obj instanceof King && ((King) obj).getColor() == this.getColor());
} }
} }

View File

@@ -20,8 +20,7 @@ public class Knight extends Piece {
return 2; return 2;
} }
@Override public boolean equals(Object obj) {
public boolean equals(Piece obj) {
return (obj instanceof Knight && ((Knight) obj).getColor() == this.getColor()); return (obj instanceof Knight && ((Knight) obj).getColor() == this.getColor());
} }
} }

View File

@@ -24,8 +24,7 @@ public class Pawn extends Piece {
return 3; return 3;
} }
@Override public boolean equals(Object obj) {
public boolean equals(Piece obj) {
return (obj instanceof Pawn && ((Pawn) obj).getColor() == this.getColor()); return (obj instanceof Pawn && ((Pawn) obj).getColor() == this.getColor());
} }
} }

View File

@@ -20,8 +20,7 @@ public class Queen extends Piece {
return 4; return 4;
} }
@Override public boolean equals(Object obj) {
public boolean equals(Piece obj) {
return (obj instanceof Queen && ((Queen) obj).getColor() == this.getColor()); return (obj instanceof Queen && ((Queen) obj).getColor() == this.getColor());
} }
} }

View File

@@ -20,8 +20,7 @@ public class Rook extends Piece {
return 5; return 5;
} }
@Override public boolean equals(Object other) {
public boolean equals(Piece obj) { return (other instanceof Rook && ((Rook) other).getColor() == this.getColor());
return (obj instanceof Rook && ((Rook) obj).getColor() == this.getColor());
} }
} }