New class for en passant and other special moves (help) (au secours)
This commit is contained in:
parent
600ad622c2
commit
8091c480a0
|
|
@ -1,5 +1,48 @@
|
||||||
package backend;
|
package backend;
|
||||||
|
|
||||||
public class SpecialMoves {
|
public class SpecialMoves {
|
||||||
|
private Piece piece;
|
||||||
|
private Board board;
|
||||||
|
private int x = piece.getX();
|
||||||
|
private int y = piece.getY();
|
||||||
|
private PieceType type = PieceType.getType();
|
||||||
|
private boolean isWhite;
|
||||||
|
|
||||||
|
/* public SpecialMoves(Piece piece, Board board) {
|
||||||
|
this.piece = piece;
|
||||||
|
this.board = board;
|
||||||
|
} //???
|
||||||
|
|
||||||
|
public boolean checkCoordinates(int x, int y, PieceType type, boolean isWhite) {
|
||||||
|
if (type == PieceType.Pawn || isWhite == true || y == 6) {
|
||||||
|
int[][] offsets = {{1, -2}, {-1, -2}};
|
||||||
|
}
|
||||||
|
if (type == PieceType.Pawn || isWhite == false || y == 1) {
|
||||||
|
int[][] offsets = {{1, 2}, {-1, 2}};
|
||||||
|
}*/
|
||||||
|
|
||||||
|
public boolean checkCoordinates(int x, int y, PieceType type, boolean isWhite) {
|
||||||
|
if (type == PieceType.Pawn || isWhite == true || y == 3) {
|
||||||
|
int[][] offsets = {{1, 0}, {-1, 0}};
|
||||||
|
|
||||||
|
}
|
||||||
|
if (type == PieceType.Pawn || isWhite == false || y == 4) {
|
||||||
|
int[][] offsets = {{1, 0}, {-1, 0}};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isEnpassant() {
|
||||||
|
boolean isWhite = piece.isWhite();
|
||||||
|
if (boolean isWhite == true|| PieceType getType() == PieceType.Pawn) { //no idea honestly
|
||||||
|
if ()
|
||||||
|
|
||||||
|
}
|
||||||
|
if (boolean isWhite == false|| //PieceType type == Pawn) {
|
||||||
|
if ()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue