package eu.jonahbauer.wizard.client.libgdx.util;

import eu.jonahbauer.wizard.common.model.Card;
import lombok.experimental.UtilityClass;

import java.util.Map;

@UtilityClass
public class CardUtil {
    @SuppressWarnings("RedundantTypeArguments")
    private static final Map<Card, Card.Suit> DEFAULT_SUITES = Map.<Card, Card.Suit>ofEntries(
            Map.entry(Card.BLUE_1, Card.Suit.BLUE),
            Map.entry(Card.BLUE_2, Card.Suit.BLUE),
            Map.entry(Card.BLUE_3, Card.Suit.BLUE),
            Map.entry(Card.BLUE_4, Card.Suit.BLUE),
            Map.entry(Card.BLUE_5, Card.Suit.BLUE),
            Map.entry(Card.BLUE_6, Card.Suit.BLUE),
            Map.entry(Card.BLUE_7, Card.Suit.BLUE),
            Map.entry(Card.BLUE_8, Card.Suit.BLUE),
            Map.entry(Card.BLUE_9, Card.Suit.BLUE),
            Map.entry(Card.BLUE_10, Card.Suit.BLUE),
            Map.entry(Card.BLUE_11, Card.Suit.BLUE),
            Map.entry(Card.BLUE_12, Card.Suit.BLUE),
            Map.entry(Card.BLUE_13, Card.Suit.BLUE),
            Map.entry(Card.RED_1, Card.Suit.RED),
            Map.entry(Card.RED_2, Card.Suit.RED),
            Map.entry(Card.RED_3, Card.Suit.RED),
            Map.entry(Card.RED_4, Card.Suit.RED),
            Map.entry(Card.RED_5, Card.Suit.RED),
            Map.entry(Card.RED_6, Card.Suit.RED),
            Map.entry(Card.RED_7, Card.Suit.RED),
            Map.entry(Card.RED_8, Card.Suit.RED),
            Map.entry(Card.RED_9, Card.Suit.RED),
            Map.entry(Card.RED_10, Card.Suit.RED),
            Map.entry(Card.RED_11, Card.Suit.RED),
            Map.entry(Card.RED_12, Card.Suit.RED),
            Map.entry(Card.RED_13, Card.Suit.RED),
            Map.entry(Card.GREEN_1, Card.Suit.GREEN),
            Map.entry(Card.GREEN_2, Card.Suit.GREEN),
            Map.entry(Card.GREEN_3, Card.Suit.GREEN),
            Map.entry(Card.GREEN_4, Card.Suit.GREEN),
            Map.entry(Card.GREEN_5, Card.Suit.GREEN),
            Map.entry(Card.GREEN_6, Card.Suit.GREEN),
            Map.entry(Card.GREEN_7, Card.Suit.GREEN),
            Map.entry(Card.GREEN_8, Card.Suit.GREEN),
            Map.entry(Card.GREEN_9, Card.Suit.GREEN),
            Map.entry(Card.GREEN_10, Card.Suit.GREEN),
            Map.entry(Card.GREEN_11, Card.Suit.GREEN),
            Map.entry(Card.GREEN_12, Card.Suit.GREEN),
            Map.entry(Card.GREEN_13, Card.Suit.GREEN),
            Map.entry(Card.YELLOW_1, Card.Suit.YELLOW),
            Map.entry(Card.YELLOW_2, Card.Suit.YELLOW),
            Map.entry(Card.YELLOW_3, Card.Suit.YELLOW),
            Map.entry(Card.YELLOW_4, Card.Suit.YELLOW),
            Map.entry(Card.YELLOW_5, Card.Suit.YELLOW),
            Map.entry(Card.YELLOW_6, Card.Suit.YELLOW),
            Map.entry(Card.YELLOW_7, Card.Suit.YELLOW),
            Map.entry(Card.YELLOW_8, Card.Suit.YELLOW),
            Map.entry(Card.YELLOW_9, Card.Suit.YELLOW),
            Map.entry(Card.YELLOW_10, Card.Suit.YELLOW),
            Map.entry(Card.YELLOW_11, Card.Suit.YELLOW),
            Map.entry(Card.YELLOW_12, Card.Suit.YELLOW),
            Map.entry(Card.YELLOW_13, Card.Suit.YELLOW),
            Map.entry(Card.RED_JESTER, Card.Suit.NONE),
            Map.entry(Card.GREEN_JESTER, Card.Suit.NONE),
            Map.entry(Card.BLUE_JESTER, Card.Suit.NONE),
            Map.entry(Card.YELLOW_JESTER, Card.Suit.NONE),
            Map.entry(Card.BOMB, Card.Suit.NONE),
            Map.entry(Card.FAIRY, Card.Suit.NONE)
    );

    public Card.Suit getDefaultTrumpSuit(Card card) {
        return card == null ? Card.Suit.NONE : DEFAULT_SUITES.get(card);
    }
}
