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") {