Implemented Rat Colony

This commit is contained in:
L_J 2018-04-17 01:37:05 +00:00 committed by GitHub
parent 8b1db5e5e3
commit 58c3cd59e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -76,12 +76,13 @@ public class Constructed extends DeckValidator {
List<String> basicLandNames = new ArrayList<>(Arrays.asList("Forest", "Island", "Mountain", "Swamp", "Plains", "Wastes",
"Snow-Covered Forest", "Snow-Covered Island", "Snow-Covered Mountain", "Snow-Covered Swamp", "Snow-Covered Plains"));
List<String> anyNumberCardsAllowed = new ArrayList<>(Arrays.asList("Relentless Rats", "Shadowborn Apostle", "Rat Colony"));
Map<String, Integer> counts = new HashMap<>();
countCards(counts, deck.getCards());
countCards(counts, deck.getSideboard());
for (Entry<String, Integer> entry : counts.entrySet()) {
if (entry.getValue() > 4) {
if (!basicLandNames.contains(entry.getKey()) && !entry.getKey().equals("Relentless Rats") && !entry.getKey().equals("Shadowborn Apostle")) {
if (!basicLandNames.contains(entry.getKey()) && !anyNumberCardsAllowed.contains(entry.getKey())) {
invalid.put(entry.getKey(), "Too many: " + entry.getValue());
valid = false;
}