last commit of day

This commit is contained in:
hugomanipoud2 2025-05-09 11:48:47 +02:00
parent 497b0a7a0d
commit d9622cdf16
3 changed files with 11 additions and 11 deletions

View File

@ -10,7 +10,7 @@ public class Main {
public static void main(String[] args) {
// testing :
Board testBoard = new Board(10, 8);
Board testBoard = new Board(8, 8);
testBoard.populateBoard();
System.out.println(testBoard.toString());

View File

@ -6,11 +6,11 @@ public class Board {
private int column;
private int line;
//initiation of the board, creating an 8 * 8 grid
public Board(int colNum, int lineNum) {
this.column = colNum;
this.line = lineNum;
}
public int getWidth() {
@ -34,9 +34,9 @@ public class Board {
public void setPiece(boolean isWhite, PieceType type, int x, int y) {
//TODO
}
//to search how to implement pieces bc ???
public void populateBoard() {
Piece whiteRook = new Piece(1, 8, PieceType.Rook, true);
}
public void cleanBoard() {
@ -50,7 +50,7 @@ public class Board {
public ArrayList<Piece> getPieces() {
ArrayList<Piece> pieces = new ArrayList<>();
//TODO
//pieces.add(whiteRook);
return pieces;
}

View File

@ -6,14 +6,14 @@ public class Piece {
private int y;
private PieceType type;
private boolean color;
private int index;
//private int index;
public Piece(int xCoord, int yCoord, PieceType typeConstructor, boolean colorConstructor, int indexPiece) {
public Piece(int xCoord, int yCoord, PieceType typeConstructor, boolean colorConstructor) {
this.x = xCoord;
this.y = yCoord;
this.type = typeConstructor;
this.color = colorConstructor;
this.index = indexPiece;
//this.index = indexPiece;
}
// xcoord of the piece
@ -36,7 +36,7 @@ public class Piece {
return color;
}
public int getIndex() {
return index;
}
//public int getIndex() {
// return index;
//}
}