prise en compte diff IA

This commit is contained in:
Kruss
2020-05-14 08:47:25 +02:00
parent 38c9dc8e26
commit f0749eb6db
4 changed files with 7 additions and 5 deletions

View File

@@ -25,7 +25,7 @@ public class Configuration {
Couple c = nomsJoueurs.get(i);
if(c.isIa()) {
joueurs.put(i,new JoueurVirtuel(c.getNom()));
joueurs.put(i,new JoueurVirtuel(c.getNom(),c.getLvlIa()));
}else {
joueurs.put(i,new Joueur(c.getNom()));
}

View File

@@ -16,6 +16,11 @@ public class JoueurVirtuel extends Joueur {
super(name);
}
public JoueurVirtuel(String nom, int lvlIa) {
super(nom);
nvDifficulte = lvlIa;
}
public Effet choisirEffet(List<Effet> effets) {
return effets.get((int) Math.floor(Math.random() * effets.size()));
}