Création de la méthode attaquer de plateau et de joueur

This commit is contained in:
Paul Gross
2020-04-21 11:46:41 +02:00
parent 10262e8792
commit 461c38ba1b
19 changed files with 163 additions and 87 deletions

View File

@@ -64,6 +64,13 @@ public class Plateau {
public void attaquer(Joueur joueur1, Joueur joueur2) {
int attaque = diffRolls();
if(attaque != 0) {
joueur1.attaquer(joueur2,attaque);
}
}
@@ -71,15 +78,16 @@ public class Plateau {
return new Joueur("0");
}
public int sumRolls() {
//pas necessaire?
return 0;
public int diffRolls() {
return Math.abs(roll6()-roll4());
}
public int roll4() {
return (int) Math.floor(Math.random() * 3)+1;
}
public int rollDices4() {
return Math.abs(roll4() - roll4());
}
@@ -91,7 +99,7 @@ public class Plateau {
public int roll6() {
return (int) Math.floor(Math.random() * 5)+1;
}
public List<Joueur> getJoueurs() {
return this.joueurs;
}