From 2d1ba67c4c7d672d3b6da66097d00741ccfbbe07 Mon Sep 17 00:00:00 2001 From: fauvet Date: Thu, 27 Apr 2023 21:23:45 +0200 Subject: [PATCH] =?UTF-8?q?Correction=20de=20petit=20bug=20de=20var=20non?= =?UTF-8?q?=20utilis=C3=A9es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AlgoAlea.java | 8 +------- Attente.java | 1 - GestionChoixAlgo.java | 6 ++++-- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/AlgoAlea.java b/AlgoAlea.java index 2850ab7..7e452f2 100644 --- a/AlgoAlea.java +++ b/AlgoAlea.java @@ -16,17 +16,11 @@ public class AlgoAlea { private JFrame cetteFrame; - public AlgoAlea(int uneTaille, boolean[][] tableau, Cellules[][] uneGrille, int visuel, JFrame uneFrame) { + public AlgoAlea(int uneTaille, boolean[][] tableau, Cellules[][] uneGrille, JFrame uneFrame) { this.map = tableau; this.grille = uneGrille; this.cetteFrame = uneFrame; this.cetteTaille = uneTaille; - - if(visuel==0){ - this.auto(); - } else if(visuel==1){ - this.manuel(); - } } /* ==================================== AUtomatique ==================================== */ diff --git a/Attente.java b/Attente.java index 5cde579..29042fc 100644 --- a/Attente.java +++ b/Attente.java @@ -2,7 +2,6 @@ import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.util.Random; import javax.swing.*; -import java.awt.*; public class Attente implements KeyListener { public static final boolean FINI = true; diff --git a/GestionChoixAlgo.java b/GestionChoixAlgo.java index f08380f..a27f980 100644 --- a/GestionChoixAlgo.java +++ b/GestionChoixAlgo.java @@ -29,7 +29,8 @@ public class GestionChoixAlgo extends JFrame implements ActionListener { if(this.ceGroupe0.getSelection().getActionCommand()=="Aalea" && this.ceGroupe1.getSelection().getActionCommand()=="Vauto") { this.frameGrille.dispose(); - AlgoAlea algorithme = new AlgoAlea(this.cetteTaille, this.cetteGrille, this.cetteGrilleCell, 0, null); + AlgoAlea algorithme = new AlgoAlea(this.cetteTaille, this.cetteGrille, this.cetteGrilleCell, null); + algorithme.auto(); } else if(this.ceGroupe0.getSelection().getActionCommand()=="Adeter" && this.ceGroupe1.getSelection().getActionCommand()=="Vauto") { @@ -37,7 +38,8 @@ public class GestionChoixAlgo extends JFrame implements ActionListener { } else if(this.ceGroupe0.getSelection().getActionCommand()=="Aalea" && this.ceGroupe1.getSelection().getActionCommand()=="Vman") { - AlgoAlea algorithme = new AlgoAlea(this.cetteTaille, this.cetteGrille, this.cetteGrilleCell, 1, this.frameGrille); + AlgoAlea algorithme = new AlgoAlea(this.cetteTaille, this.cetteGrille, this.cetteGrilleCell, this.frameGrille); + algorithme.manuel(); } else if(this.ceGroupe0.getSelection().getActionCommand()=="Adeter" && this.ceGroupe1.getSelection().getActionCommand()=="Vman") {