board and piece : define height width and define piece color, position

This commit is contained in:
lrave 2025-04-10 11:37:20 +02:00
parent 9f7162ce6d
commit 4874c7c7a4
2 changed files with 23 additions and 11 deletions

View File

@ -4,18 +4,20 @@ import java.util.ArrayList;
public class Board {
private int width;
private int height;
public Board(int colNum, int lineNum) {
//TODO
this.width = colNum;
this.height = lineNum;
}
public int getWidth() {
//TODO
return 0;
return width;
}
public int getHeight() {
//TODO
return 0;
return height;
}
public int getTurnNumber() {

View File

@ -1,21 +1,31 @@
package backend;
public class Piece {
private int x;
private int y;
private boolean pieceColor;
private PieceType type;
public Piece(int x,int y, PieceType type,boolean pieceColor) {
this.x = x;
this.y = y;
this.pieceColor = pieceColor;
}
public int getX() {
return 0;
return x;
}
public int getY() {
return 0;
return y;
}
public PieceType getType() {
return null;
return type;
}
public boolean isWhite() {
return false;
public boolean isWhite(boolean PieceColor) {
return pieceColor;
}
}
}