package com.example.jmastermind.Deck;

import android.graphics.Color;
import java.util.LinkedList;
import java.util.List;

public class DeckLambda implements Deck{
    List<Integer> deck;

    /**
     * Composition de la combinaison attaquante
     * @param c1 Couleur en int du Pion n1
     * @param c2 Couleur en int du Pion n2
     * @param c3 Couleur en int du Pion n3
     * @param c4 Couleur en int du Pion n4
     * */
    public DeckLambda(Integer c1, Integer c2, Integer c3, Integer c4) {
        this.deck = new LinkedList<>();
        this.deck.add(c1);
        this.deck.add(c2);
        this.deck.add(c3);
        this.deck.add(c4);
    }

    @Override
    public List<Integer> getDeck() {
        return this.deck;
    }

    @Override
    public String displayComb() {
        StringBuilder sb = new StringBuilder();

        for(int i = 0; i <= this.deck.size()-1; i++) {
            switch(this.deck.get(i)) {
                case Color.BLACK: {
                    sb.append("Noir").append(", ");
                    break;
                }

                case Color.WHITE: {
                    sb.append("Blanc").append(", ");
                    break;
                }

                case Color.GREEN: {
                    sb.append("Vert").append(", ");
                    break;
                }

                case Color.RED: {
                    sb.append("Rouge").append(", ");
                    break;
                }

                case Color.YELLOW: {
                    sb.append("Jaune").append(", ");
                    break;
                }

                case Color.BLUE: {
                    sb.append("Bleu").append(", ");
                    break;
                }

                case Color.GRAY: {
                    sb.append("Gris").append(", ");
                    break;
                }
            }
        }

        return sb.toString();
    }
}
