Files
HidekoBot/src/main/java/wtf/beatrice/hidekobot/objects/Dice.java
Lorenzo Dellacà f0ee565185
All checks were successful
continuous-integration/drone/push Build is passing
Implement basic functional diceroll command
2022-12-19 01:36:43 +01:00

46 lines
741 B
Java

package wtf.beatrice.hidekobot.objects;
import wtf.beatrice.hidekobot.util.RandomUtil;
import java.util.UUID;
public class Dice
{
private final int sides;
private int value = 0;
private final UUID uuid;
public Dice(int sides)
{
this.sides = sides;
this.uuid = UUID.randomUUID();
}
public Dice(Dice old)
{
this.sides = old.sides;
this.value = old.value;
this.uuid = UUID.randomUUID();
}
public int getValue()
{
return value;
}
public int getSides()
{
return sides;
}
public void roll()
{
value = RandomUtil.getRandomNumber(1, sides);
}
public UUID getUUID()
{
return uuid;
}
}