package domain;

import java.util.ArrayList;

public class Player {

    private String name;
    private Hand hand;
    private Box box;
    private String savedGamemode;

    public Player(String name, String gamemode) {

        this.name = name;
        this.hand = new Hand(gamemode);
        this.box = new Box(gamemode);
        this.savedGamemode = gamemode;

    }

    public void getNewHand() {

        this.hand = new Hand(this.savedGamemode);

    }

    public String getPlayername(){
        return this.name;
    }

    public void rollDices(){
        this.hand.rollDices();

    }

    public int getLeftRolls(){

        return hand.getLeftRolls();
    }
    
    public ArrayList<Integer> getAllDiceNumbers(){

        return hand.getAllDiceNumbers();
    }

    public ArrayList<Integer> getFreeDiceNumbers(){

        return hand.getFreeDiceNumbers();
    }

    public ArrayList<Integer> getLockedInDiceNumbers(){

        return hand.getLockedInDiceNumbers();
    }

    public int getLockedInDiceAmount(){
        return hand.getLockedInDiceAmount();

    }

    public void lockInDices(String... dices){

        hand.lockInDices(dices);
    }

    public boolean autoLockInDices(){

        return hand.autoLockInDices();
    }

    public boolean allDicesLockedIn(){
        return allDicesLockedIn();

    }

    public void evaluateAllOptions(){

        box.evaluateBoxOptions(hand.getLockedInDiceNumbers());
    }
    public ArrayList<String> getAllOptions(){
        return box.getAllOptions();
    }
    public void selectOption(String selectedOption){

        box.selectOption(selectedOption);
    }

    public void resetOptions(){
        box.resetOptions();

    }

    public void updateBonus(){
        box.updateBonus();
    }

    public void updateUpperBoxScore(){
        box.updateUpperBoxScore();
    }

    public void updateLowerBoxScore(){
        box.updateLowerBoxScore();
    }

    public void updateTotalScore(){
        box.updateTotalScore();
    }

    public boolean onlyOneOption(){

        return box.onlyOneOption();
    }

    public String selectedOptionsPrinted(){

        return box.selectedOptionsPrinted();
    }
    public boolean gameOver(){

        return box.gameOver();
    }

    public int returnTotalPoints(){
        return box.returnTotalPoints();
    }
}
