2024-04-29 21:06:04 +02:00
|
|
|
package domain;
|
|
|
|
|
2024-04-30 12:46:42 +02:00
|
|
|
import java.util.Random;
|
|
|
|
|
2024-04-29 21:06:04 +02:00
|
|
|
public class Dice {
|
2024-04-30 12:46:42 +02:00
|
|
|
private int amountSides;
|
|
|
|
|
|
|
|
public Dice(int amountSides){
|
|
|
|
this.amountSides = amountSides;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int roll(){
|
|
|
|
Random rand = new Random();
|
|
|
|
return (rand.nextInt(amountSides) + 1);
|
|
|
|
}
|
2024-04-29 21:06:04 +02:00
|
|
|
}
|