2024-05-02 11:26:21 +02:00
|
|
|
package Domain;
|
|
|
|
|
|
|
|
import java.util.Random;
|
|
|
|
|
|
|
|
public class Dice {
|
|
|
|
private int numberOfDice;
|
|
|
|
|
|
|
|
public Dice(int numberOfDice){
|
|
|
|
this.numberOfDice = numberOfDice;
|
|
|
|
}
|
|
|
|
|
2024-05-02 12:46:36 +02:00
|
|
|
public int rollDice(int numberOfDice){
|
2024-05-02 11:26:21 +02:00
|
|
|
Random random = new Random();
|
|
|
|
numberOfDice = random.nextInt(6);
|
2024-05-02 12:46:36 +02:00
|
|
|
return numberOfDice + 1;
|
2024-05-02 11:26:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public int getAugenzahl(){
|
|
|
|
return numberOfDice;
|
|
|
|
}
|
|
|
|
}
|