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:
parent
385f457154
commit
3fe51e6652
|
|
@ -16,12 +16,12 @@ public class Board {
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getWidth() {
|
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;
|
return width;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getHeight() {
|
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;
|
return height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -43,6 +43,8 @@ public class Board {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void populateBoard() {
|
public void populateBoard() {
|
||||||
|
|
||||||
|
board[0][0] = new Piece(false, PieceType.Rook, 0, 0);
|
||||||
/*
|
/*
|
||||||
// Place Rooks
|
// Place Rooks
|
||||||
board[0][0] = new Rook(PieceColor.BLACK, new Position(0, 0));
|
board[0][0] = new Rook(PieceColor.BLACK, new Position(0, 0));
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,13 @@ public class Piece {
|
||||||
int y;
|
int y;
|
||||||
private PieceType type;
|
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() {
|
public int getX() {
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue