king, copy board logic, getPseudoMoves
This commit is contained in:
11
Pawn.java
11
Pawn.java
@@ -11,7 +11,12 @@ public class Pawn extends Piece {
|
||||
colorDir = color.equals("White") ? -1 : 1;
|
||||
}
|
||||
|
||||
public ArrayList<Position> getLegalMoves(Board board) {
|
||||
public Piece copy() {
|
||||
Piece newP = new Pawn(this.pos.x, this.pos.y, this.color);
|
||||
return newP;
|
||||
}
|
||||
|
||||
public ArrayList<Position> getPseudoLegalMoves(Board board) {
|
||||
ArrayList<Position> positions = new ArrayList<Position>();
|
||||
|
||||
// diagonal moves (captures)
|
||||
@@ -38,4 +43,8 @@ public class Pawn extends Piece {
|
||||
}
|
||||
return positions;
|
||||
}
|
||||
|
||||
public ArrayList<Position> getLegalMoves(Board board) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user