Commander Quest checkstyle and bugfixes

-QuestEventCommanderDuelManager
Removed unused imports

-CEditorQuest
Fixed colorless cards getting filtered out of deck creation.
This commit is contained in:
Jeremy Pelkala
2018-11-08 11:51:21 -05:00
parent 3dfcf64d30
commit ffcc38d8c4
2 changed files with 7 additions and 5 deletions

View File

@@ -322,7 +322,7 @@ public final class CEditorQuest extends CDeckEditor<Deck> {
public boolean apply(PaperCard subject) {
CardRules cr = subject.getRules();
ManaCost mc = cr.getManaCost();
return !mc.isPureGeneric() && allowedColor.containsAllColorsFrom(cr.getColorIdentity().getColor());
return allowedColor.containsAllColorsFrom(cr.getColorIdentity().getColor());
}
}
@@ -336,7 +336,10 @@ public final class CEditorQuest extends CDeckEditor<Deck> {
List<String> colors = new ArrayList<>();
//Return early if there are no current commanders
if(commanders.size() == 0) return ColorSet.fromNames(colors);
if(commanders.size() == 0){
colors.add("c");
return ColorSet.fromNames(colors);
}
//For each commander,add each color of its color identity if not already added
for(PaperCard pc : commanders){
@@ -347,6 +350,8 @@ public final class CEditorQuest extends CDeckEditor<Deck> {
if(!colors.contains("g") && pc.getRules().getColorIdentity().hasGreen()) colors.add("g");
}
colors.add("c");
return ColorSet.fromNames(colors);
}

View File

@@ -4,10 +4,7 @@ import forge.deck.*;
import forge.item.PaperCard;
import forge.model.FModel;
import forge.quest.data.QuestPreferences;
import forge.util.CollectionSuppliers;
import forge.util.MyRandom;
import forge.util.maps.EnumMapOfLists;
import forge.util.maps.MapOfLists;
import java.util.ArrayList;
import java.util.Collections;