package it.polimi.ingsw.gc14.Model.GamePackage;

import it.polimi.ingsw.gc14.Model.Player;
import it.polimi.ingsw.gc14.Model.Slot;
import it.polimi.ingsw.gc14.Model.GamePackage.GameStages;

public class CurrentState {
    // region Getters
    private Player player;
    public Player getCurrentPlayer(){
        return player;
    }

    private Slot slot;
    public Slot getSlot(){
        return slot;
    }

    private int Era;
    public int getEra(){
        return Era;
    }

    private int round;
    public int getRound(){
        return round;
    }

    private int NUpper;
    public int getNUpper(){
        return NUpper;
    }

    private int NLower;
    public int getNLower(){
        return NLower;
    }

    private GameStages GameStage;
    public GameStages getGameStage(){
        return GameStage;
    }

    // endregion getters

    // region Setters
    public void EraUpdate(){
        Era++;
    }

    public void RoundUpdate(){
        round++;
    }

    public void UpperDrawn(){
        NUpper--;
    }

    public void LowerDrawn(){
        NLower--;
    }

    public void GameStageUpdate(GameStages GameStage){
        this.GameStage = GameStage;
    }
    // endregion setters

    // region Constructors
    public CurrentState(){
        this.player = null;
        this.slot = null;
        this.Era = 1;
        this.round = 1;
        this.NUpper = 0;
        this.NLower = 0;
        this.GameStage = GameStages.WAITING;
    }
    // endregion constructors

    // region Functions
    public void PlayerUpdate(Player player, Slot slot){
        this.player = player;
        this.slot = slot;
        if(slot == null){
            this.NUpper = 0;
            this.NLower = 0;
        }
        else{
            this.NUpper = slot.getNUpper();
            this.NLower = slot.getNLower();
        }

    }
    // endregion functions
}
