This commit is contained in:
Cyprien111
2025-04-14 10:21:28 +02:00
3 changed files with 7 additions and 1 deletions

View File

@@ -273,7 +273,7 @@ public class GomokuBoard {
int max = 0; int max = 0;
for (Map.Entry<Cardinal, Integer> entry : mapColor.entrySet()) { for (Map.Entry<Cardinal, Integer> entry : mapColor.entrySet()) {
if(entry.getValue() > max){ if (entry.getValue() > max) {
max = entry.getValue(); max = entry.getValue();
} }
} }

View File

@@ -149,6 +149,7 @@ public class GomokuGame {
} }
System.out.println(board.countMax(board.countAlignedCells(currentPlay))); System.out.println(board.countMax(board.countAlignedCells(currentPlay)));
if (NB_CELL_PLAY <= board.countMax(board.countAlignedCells(currentPlay))) { if (NB_CELL_PLAY <= board.countMax(board.countAlignedCells(currentPlay))) {
System.out.println("Le joueur " + this.currentPlayer + " a gagné !");
// this.renderer.updateStatus("Le joueur " + this.currentPlayer + "a gagné !"); // this.renderer.updateStatus("Le joueur " + this.currentPlayer + "a gagné !");
return; return;
} }

View File

@@ -54,4 +54,9 @@ abstract class Player{
* @return The cell of the move played. * @return The cell of the move played.
*/ */
public abstract GomokuCell chooseMove(GomokuBoard board); public abstract GomokuCell chooseMove(GomokuBoard board);
@Override
public String toString() {
return this.getName();
}
} }