package domain;

public class Dice {

    private int diceNumber;
    private String savedGamemode;

    public Dice(String gamemode) {
        this.savedGamemode = gamemode;
        if (gamemode.equals("Normal") || gamemode.equals("StarWarsDay"))
            this.diceNumber = (int) Math.random() * 6 + 1;
        else if (gamemode.equals("Special8"))
            this.diceNumber = (int) Math.random() * 8 + 1;
    }

    public Dice(String gamemode, int diceNumber) {
        this.savedGamemode = gamemode;
        this.diceNumber = diceNumber;
    }

    public void rerollDice() {

        if (this.savedGamemode.equals("Normal") || this.savedGamemode.equals("StarWarsDay"))
            this.diceNumber = (int) Math.random() * 6 + 1;
        else if (this.savedGamemode.equals("Special8"))
            this.diceNumber = (int) Math.random() * 8 + 1;

    }

    public int getDiceNumber() {

        return this.diceNumber;

    }

}
