Refactor console rendering

This commit is contained in:
Dorian HAMDANI
2025-04-14 10:54:24 +02:00
parent 0eb7f1442e
commit c0517b8f1e
2 changed files with 13 additions and 21 deletions

View File

@@ -160,20 +160,16 @@ public class GomokuGame {
this.board.expandBoard(cardinal);
}
}
System.out.println(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;
}
this.currentPlayer.tokens -= 1;
this.currentPlayer = this.nextPlayer();
renderer.update();
// System.out.println(this.board);
}
// this.renderer.updateStatus("Match nul, il ne reste plus de jeton.");
System.out.println("Match nul, il ne reste plus de jeton");
this.renderer.updateStatus("Match nul, il ne reste plus de jetons.");
return;
}