normally rhe code should work to see display modify this : public

ArrayList<Piece> getPieces() {
		ArrayList<Piece> pieces = new ArrayList<>();
		//TODO

		return pieces;
	}
This commit is contained in:
Jérôme BEDIER 2025-04-18 17:31:44 +02:00
parent 385f457154
commit 3fe51e6652
2 changed files with 11 additions and 2 deletions

View File

@ -16,12 +16,12 @@ public class Board {
}
public int getWidth() {
width = 8; // setting the width at 8 for the moment can be changed
//width = 8; // setting the width at 8 for the moment can be changed
return width;
}
public int getHeight() {
height = 8; // setting the height at 8 for the moment can be changed
//height = 8; // setting the height at 8 for the moment can be changed
return height;
}
@ -43,6 +43,8 @@ public class Board {
}
public void populateBoard() {
board[0][0] = new Piece(false, PieceType.Rook, 0, 0);
/*
// Place Rooks
board[0][0] = new Rook(PieceColor.BLACK, new Position(0, 0));

View File

@ -6,6 +6,13 @@ public class Piece {
int y;
private PieceType type;
public Piece(boolean whitePiece, PieceType type, int x, int y) {
this.whitePiece = whitePiece;
this.type = type;
this.x = x;
this.y = y;
}
public int getX() {
return x;
}