package cards.maumau.model;

import cards.Card;
import cards.Suit;
import cards.Rank;

public class SuitChosen implements HandlerState{
    private final ActionHandler handler;

    SuitChosen(ActionHandler handler) {
        this.handler = handler;
    }

    public void addPlayer(Player player){}
    public void startGame(){}
    public void finishGame(){}
    public void cancelGame(){}

    public void chooseCard(Card c){
        if (handler.canPlay(c)) {
            handler.setChosenSuit(null);
            handler.getGame().getPlayerHandler().getCurrentPlayer().playCard(c);

            if(c.rank() == Rank.SEVEN) {
                handler.increment7Counter();
                handler.getGame().getPlayerHandler().nextTurn(1);
                handler.setHandlerState(new SevenChosen(handler));
            } else if (c.rank() == Rank.EIGHT) {
                handler.getGame().getPlayerHandler().nextTurn(2);
                handler.setHandlerState(new Normal(handler));
            } else {
                handler.getGame().getPlayerHandler().nextTurn(1);
                handler.setHandlerState(new Normal(handler));
            }

        }
    }

    public void chooseSuit(Suit suit){}

    public void skip(){
        handler.getGame().getPlayerHandler().getCurrentPlayer().drawCards(1);
        handler.getGame().getPlayerHandler().nextTurn(1);
    }

    public void no7(){}
}
