/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.derniereligne.engine.cards.trumps;

import com.derniereligne.engine.Color;
import com.derniereligne.engine.Player;

/**
 *
 * @author gaussreload
 */
public class RemovingColorTrumpCard extends TrumpCard{
    private Color[] removedColors;

    private final EnumSet<Color> removedColors;

    public RemovingColorTrumpCard(String name, int duration, String description,
            int cost, Color... colors) {
        super(name, duration, description, cost);
        if (colors.equals(Color.ALL)) {
            removedColors = Color.values();
        } else {
            removedColors = colors;
        }
    }

    @Override
    public void affect(Player player) {
        for (Color color : removedColors) {
            player.getDeck().removePossibleColorFromHand(color);
        }
    }

}

@@ -304,16 +304,90 @@
 .Player;
+%0Aimport java.util.Arrays;%0Aimport java.util.EnumSet;%0Aimport java.util.List;
 %0A%0A/**%0A *
@@ -387,16 +387,19 @@
 %0A/**%0A *%0A
+ *%0A
  * @auth
@@ -405,19 +405,63 @@
 hor 
-gaussreload
+%22Derni%C3%A8re Ligne%22 first development team%0A * @version 1.0
 %0A */
@@ -518,44 +518,10 @@
 Card
+ 
 %7B
-%0A    private Color%5B%5D removedColors;
 %0A%0A  
@@ -751,24 +751,143 @@
     
-if (colors.equal
+removedColors = EnumSet.noneOf(Color.class);%0A        List%3CColor%3E colorsAsList = Arrays.asList(colors);%0A        if (colorsAsList.contain
 s(Co
@@ -923,19 +923,38 @@
 edColors
- = 
+.addAll(Arrays.asList(
 Color.va
@@ -959,16 +959,18 @@
 values()
+))
 ;%0A      
@@ -1009,17 +1009,29 @@
 lors
- = colors
+.addAll(colorsAsList)
 ;%0A  

use an EnumSet for the colors instead of an array.