highlight failed
This commit is contained in:
parent
1a029cdd10
commit
c1e6a46140
|
|
@ -120,7 +120,7 @@ public class Board {
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
private Piece getPieceAt(int x, int y) {
|
public Piece getPieceAt(int x, int y) {
|
||||||
for (Piece p : pieces) {
|
for (Piece p : pieces) {
|
||||||
if (p.getX() == x && p.getY() == y) {
|
if (p.getX() == x && p.getY() == y) {
|
||||||
return p;
|
return p;
|
||||||
|
|
@ -171,7 +171,6 @@ public class Board {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean isSelected(int x, int y) {
|
public boolean isSelected(int x, int y) {
|
||||||
// Check if the selected coordinates match the given x and y
|
// Check if the selected coordinates match the given x and y
|
||||||
if (selectedX != null && selectedY != null) {
|
if (selectedX != null && selectedY != null) {
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,15 @@
|
||||||
package backend;
|
package backend;
|
||||||
|
|
||||||
public class Piece {
|
public class Piece {
|
||||||
private int x;
|
private int x;
|
||||||
private int y;
|
private int y;
|
||||||
private PieceType type;
|
private PieceType type;
|
||||||
private boolean isWhite;
|
private boolean isWhite; // true if the piece is white, false if black
|
||||||
|
|
||||||
public Piece(int x, int y, PieceType type, boolean isWhite) {
|
public Piece(int x, int y, PieceType type, boolean isWhite) {
|
||||||
this.x = x;
|
this.x = x;
|
||||||
this.y = y;
|
this.y = y;
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.isWhite = isWhite; // true if the piece is white, false if black
|
this.isWhite = isWhite;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getX() {
|
public int getX() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue