added rook, created bishop file

This commit is contained in:
CT
2026-04-23 23:07:22 -05:00
parent ce61482b9e
commit 984c37a833
9 changed files with 148 additions and 8 deletions

View File

@@ -1,8 +1,7 @@
import java.awt.*;
import java.util.*;
public class Piece {
ArrayList<Integer> legalMoves;
public abstract class Piece {
Position pos;
Image sprite;
String color;
@@ -17,10 +16,7 @@ public class Piece {
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;
}
public abstract ArrayList<Position> getLegalMoves(Board board);
public boolean colorMatches(Piece p) {
return this.color.equals(p.color);