Bot Divin et AvalamWindow connecté

This commit was merged in pull request #22.
This commit is contained in:
2026-01-30 14:11:13 +01:00
parent 7ae0d69aaa
commit 32f77e5495
2 changed files with 80 additions and 88 deletions

View File

@@ -2,7 +2,7 @@ package fr.iut_fbleau.Avalam;
import fr.iut_fbleau.Bot.AlphaBetaBot;
// A FAIRE PLUS TARD (PVGOD)
// import fr.iut_fbleau.Bot.DivineBot;
import fr.iut_fbleau.Bot.DivineBot;
import fr.iut_fbleau.Bot.IdiotBot;
import fr.iut_fbleau.GameAPI.AbstractPly;
import fr.iut_fbleau.GameAPI.Player;
@@ -59,6 +59,8 @@ public class AvalamWindow extends JFrame {
/** Bot Alpha-Beta (utilisé si mode PVALPHA). */
private final AlphaBetaBot alphaBot;
private final DivineBot divineBot;
// A FAIRE PLUS TARD (PVGOD)
// /** Bot Divin (utilisé si mode PVGOD). */
// private final DivineBot divineBot;
@@ -68,7 +70,6 @@ public class AvalamWindow extends JFrame {
* On garde l'attribut à null pour ne pas casser la compilation,
* mais toute la logique PVGOD est désactivée/commentée.
*/
private final Object divineBot = null;
/** Indique si une animation de tour de bot est en cours. */
private boolean botAnimating = false;
@@ -110,7 +111,7 @@ public class AvalamWindow extends JFrame {
this.alphaBot = (mode == GameMode.PVALPHA) ? new AlphaBetaBot(botPlayer, depth) : null;
// A FAIRE PLUS TARD (PVGOD)
// this.divineBot = (mode == GameMode.PVGOD) ? new DivineBot(botPlayer, depth) : null;
this.divineBot = (mode == GameMode.PVGOD) ? new DivineBot(botPlayer, depth) : null;
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLayout(new BorderLayout());
@@ -220,11 +221,10 @@ public class AvalamWindow extends JFrame {
if (mode == GameMode.PVALPHA && alphaBot == null) return;
// A FAIRE PLUS TARD (PVGOD)
// if (mode == GameMode.PVGOD && divineBot == null) return;
if (mode == GameMode.PVGOD && divineBot == null) return;
// A FAIRE PLUS TARD (PVGOD)
// Pour l'instant, si PVGOD est sélectionné, on ne joue pas de coup bot.
if (mode == GameMode.PVGOD) return;
botAnimating = true;
@@ -239,8 +239,7 @@ public class AvalamWindow extends JFrame {
botMove = alphaBot.giveYourMove(board.safeCopy());
} else {
// A FAIRE PLUS TARD (PVGOD)
// botMove = divineBot.giveYourMove(board.safeCopy());
botMove = null;
botMove = divineBot.giveYourMove(board.safeCopy());
}
if (botMove == null) {