This commit is contained in:
Aubin DORIVAL
2025-03-31 11:57:46 +02:00
parent 2eb2dd373c
commit 0867ea36c1

View File

@@ -33,6 +33,12 @@ public class GomokuBoard{
this(width, height, null);
}
/**
* This constructor take the width and the height to creat a board of gomoku.
* @param width Size of width.
* @param height Size of height.
* @param colors Is colors of cells after load a game.
*/
public GomokuBoard(int width, int height, Color[][] colors){
this.firstCell = new GomokuCell(Color.NIL);
this.boardWidth = width;
@@ -41,6 +47,12 @@ public class GomokuBoard{
}
/**
* This method gen all cells in the board and link each other.
* @param width Size of width.
* @param height Size of height.
* @param colors Array of Color.
*/
private void genCells(int width, int height, Color[][] colors){
this.firstCell = new GomokuCell(colors == null ? Color.NIL : colors[0][0]);
GomokuCell act = this.firstCell;