basic lands now do have color identity, so deck format check no longer needs an exception for them

This commit is contained in:
Maxmtg
2013-05-26 13:20:22 +00:00
parent 8352460a8c
commit ce2d19ab90
2 changed files with 1 additions and 41 deletions

View File

@@ -98,20 +98,6 @@ public final class Constant {
/** The Basic lands. */
public static final List<String> BASIC_LANDS = Collections.unmodifiableList(Arrays.asList("Plains", "Island", "Swamp", "Mountain", "Forest"));
public static final Map<String, String> COLOR_TO_BASIC_LAND_TYPE_MAP;
static
{
Map<String, String> colToType = new HashMap<String, String>();
colToType.put(Color.WHITE, "Plains");
colToType.put(Color.BLUE, "Island");
colToType.put(Color.BLACK, "Swamp");
colToType.put(Color.RED, "Mountain");
colToType.put(Color.GREEN, "Forest");
COLOR_TO_BASIC_LAND_TYPE_MAP = Collections.unmodifiableMap(colToType);
}
public static final Map<String, String> BASIC_LAND_TYPE_TO_COLOR_MAP;
static

View File

@@ -158,40 +158,14 @@ public enum DeckFormat {
{
erroneousCI.add(cp.getKey());
}
if(cp.getKey().getRules().getType().isLand())
{
for(String key : Constant.Color.COLOR_TO_BASIC_LAND_TYPE_MAP.keySet())
{
if(!cmdCI.hasAnyColor(MagicColor.fromName(key)))
{
if(cp.getKey().getRules().getType().subTypeContains(Constant.Color.COLOR_TO_BASIC_LAND_TYPE_MAP.get(key)))
{
erroneousCI.add(cp.getKey());
}
}
}
}
}
if(deck.get(DeckSection.Sideboard) != null)
if(deck.has(DeckSection.Sideboard))
{
for(Entry<CardPrinted, Integer> cp : deck.get(DeckSection.Sideboard)) {
if(!cp.getKey().getRules().getColorIdentity().hasNoColorsExcept(cmdCI.getColor()))
{
erroneousCI.add(cp.getKey());
}
if(cp.getKey().getRules().getType().isLand())
{
for(String key : Constant.Color.COLOR_TO_BASIC_LAND_TYPE_MAP.keySet())
{
if(!cmdCI.hasAnyColor(MagicColor.fromName(key)))
{
if(cp.getKey().getRules().getType().subTypeContains(Constant.Color.COLOR_TO_BASIC_LAND_TYPE_MAP.get(key)))
{
erroneousCI.add(cp.getKey());
}
}
}
}
}
}