width and height method working - can be changed also

This commit is contained in:
Jérôme BEDIER 2025-04-18 15:19:59 +02:00
parent ee3491a243
commit 1cea1d46e0
1 changed files with 9 additions and 5 deletions

View File

@ -4,19 +4,23 @@ import java.util.ArrayList;
public class Board { public class Board {
private Piece[][] board; private Piece[][] board;
private int width;
private int height;
public Board(int colNum, int lineNum) { public Board(int colNum, int lineNum) {
this.board = new Piece[8][8]; // 8x8 chess board this.width = colNum; // col move x
this.height = lineNum; // line mov in y
this.board = new Piece[width][height]; // 8x8 chess board
} }
public int getWidth() { public int getWidth() {
//TODO width = 8; // 8 for the moment can be changed
return 0; return width;
} }
public int getHeight() { public int getHeight() {
//TODO height = 8; // 8 for the moment can be changed
return 0; return height;
} }
public int getTurnNumber() { public int getTurnNumber() {