oard java and piece java new

This commit is contained in:
Marius 2025-04-15 08:30:59 +02:00
parent 2f24aa722d
commit 6d42ba903a
2 changed files with 29 additions and 6 deletions

View File

@ -3,19 +3,25 @@ package backend;
import java.util.ArrayList;
public class Board {
//Board dimensions
private int width;
private int height;
public Board(int colNum, int lineNum) {
this.width = colNum;
this.height = lineNum;
//TODO
}
public int getWidth() {
//TODO
return 0;
return width;
}
public int getHeight() {
//TODO
return 0;
return height;
}
public int getTurnNumber() {

View File

@ -1,21 +1,38 @@
package backend;
public class Piece {
//Variables to store piece properties
private int x;
private int y;
private PieceType type;
private boolean isWhite;
public Piece(int x, int y, PieceType type, boolean isWhite) {
this.x = x;
this.y = y;
this.type = type;
this.isWhite = isWhite;
}
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;
return isWhite;
}
public void setPosition(int x, int y) {
this.x = x;
this.y = y;
}
}