From 642cdea2f896f38ee79097670a97945583aff422 Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Fri, 12 Jun 2020 00:18:40 +0400 Subject: [PATCH] Added single cards support in constructed format (like historic, see #6626); --- Mage/src/main/java/mage/cards/decks/Constructed.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Mage/src/main/java/mage/cards/decks/Constructed.java b/Mage/src/main/java/mage/cards/decks/Constructed.java index 8718c63540..7213b6b718 100644 --- a/Mage/src/main/java/mage/cards/decks/Constructed.java +++ b/Mage/src/main/java/mage/cards/decks/Constructed.java @@ -27,6 +27,7 @@ public class Constructed extends DeckValidator { protected List restricted = new ArrayList<>(); protected List setCodes = new ArrayList<>(); protected List rarities = new ArrayList<>(); + protected Set singleCards = new HashSet<>(); public Constructed() { super("Constructed"); @@ -153,7 +154,7 @@ public class Constructed extends DeckValidator { } /** - * Checks if the given card is legal in any of the given sets + * Checks if the given card is legal in any of the given sets or as single card * * @param card - the card to check * @return Whether the card was printed in any of this format's sets. @@ -168,6 +169,12 @@ public class Constructed extends DeckValidator { break; } } + + // check if single card allows + if (singleCards.contains(card.getName())) { + legal = true; + } + if (!legal && !invalid.containsKey(card.getName())) { invalid.put(card.getName(), "Invalid set: " + card.getExpansionSetCode()); }