mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
Added single cards support in constructed format (like historic, see #6626);
This commit is contained in:
parent
c592542ff6
commit
642cdea2f8
1 changed files with 8 additions and 1 deletions
|
@ -27,6 +27,7 @@ public class Constructed extends DeckValidator {
|
|||
protected List<String> restricted = new ArrayList<>();
|
||||
protected List<String> setCodes = new ArrayList<>();
|
||||
protected List<Rarity> rarities = new ArrayList<>();
|
||||
protected Set<String> 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());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue