pawn moves check
This commit is contained in:
16
Piece.java
16
Piece.java
@@ -3,16 +3,22 @@ import java.util.*;
|
||||
|
||||
public class Piece {
|
||||
ArrayList<Integer> legalMoves;
|
||||
int x, y;
|
||||
Position pos;
|
||||
Image sprite;
|
||||
String color;
|
||||
|
||||
public Piece(int x, int y, Image sprite) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
public Piece(int x, int y, String color, Image sprite) {
|
||||
this.pos = new Position(x, y);
|
||||
this.color = color;
|
||||
this.sprite = sprite;
|
||||
}
|
||||
|
||||
public void draw(Graphics g) {
|
||||
g.drawImage(sprite, x * 40, y * 40, null);
|
||||
g.drawImage(sprite, pos.x * 40, pos.y * 40, null);
|
||||
}
|
||||
|
||||
public ArrayList<Position> getLegalMoves(Board board) {
|
||||
System.out.println("parent method not overriden");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user