Création de la méthode attaquer de plateau et de joueur
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user