changements IA
This commit is contained in:
@@ -7,6 +7,7 @@ import java.util.Random;
|
||||
import carte.CarteEquipement;
|
||||
import carte.CarteEquipementStat;
|
||||
import effet.Effet;
|
||||
import javafx.scene.control.Button;
|
||||
|
||||
public class JoueurVirtuel extends Joueur {
|
||||
|
||||
@@ -21,7 +22,7 @@ public class JoueurVirtuel extends Joueur {
|
||||
nvDifficulte = lvlIa;
|
||||
}
|
||||
|
||||
public Effet choisirEffet(List<Effet> effets) {
|
||||
public Button choisirEffet(List<Button> effets) {
|
||||
return effets.get((int) Math.floor(Math.random() * effets.size()));
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import carte.Carte;
|
||||
import carte.CarteEquipement;
|
||||
@@ -372,9 +373,8 @@ public class Plateau extends Thread{
|
||||
}
|
||||
|
||||
private int rollRandom(int nb) {
|
||||
|
||||
int roll = (int) Math.floor(Math.random() * (nb))+1;
|
||||
System.out.println("roll" + roll);
|
||||
Random r= new Random();
|
||||
int roll = r.nextInt(nb)+1;
|
||||
return roll;
|
||||
}
|
||||
|
||||
@@ -384,13 +384,12 @@ public class Plateau extends Thread{
|
||||
int roll4 = 0;
|
||||
int roll6 = 0;
|
||||
|
||||
roll4 =rollRandom(4);
|
||||
roll4 = rollRandom(4);
|
||||
roll6 = rollRandom(6);
|
||||
sum = Math.abs(roll4+roll6);
|
||||
|
||||
gj.rollDice(j, PlateauController.DICE_BOTH, roll4,roll6);
|
||||
return 3;
|
||||
//return sum;
|
||||
return sum;
|
||||
}
|
||||
|
||||
public List<Joueur> getJoueurs() {
|
||||
|
||||
Reference in New Issue
Block a user