change some size() comparisons, to isEmpty()

This commit is contained in:
Ingmar Goudt 2019-07-14 20:53:23 +02:00
parent 5ba206111a
commit eb0cfc94f8
23 changed files with 35 additions and 36 deletions

View file

@ -115,7 +115,7 @@ public class Commander extends Constructed {
}
}
if (deck.getSideboard().size() < 1 || deck.getSideboard().size() > 2) {
if (deck.getSideboard().isEmpty() || deck.getSideboard().size() > 2) {
if ((deck.getSideboard().size() > 1 && !partnerAllowed)) {
invalid.put("Commander", "You may only have one commander");
}

View file

@ -68,7 +68,7 @@ public class FreeformCommander extends Constructed {
}
}
if (deck.getSideboard().size() < 1 || deck.getSideboard().size() > 2) {
if (deck.getSideboard().isEmpty() || deck.getSideboard().size() > 2) {
invalid.put("Commander", "Sideboard must contain only the commander(s)");
valid = false;
} else {

View file

@ -134,11 +134,11 @@ public class Oathbreaker extends Vintage {
}
// check size (1+1 or 2+2 allows)
if (commanderNames.size() == 0 || commanderNames.size() > 2) {
if (commanderNames.isEmpty() || commanderNames.size() > 2) {
invalid.put("Oathbreaker", "Sideboard must contains 1 or 2 oathbreakers, but found: " + commanderNames.size());
valid = false;
}
if (signatureSpells.size() == 0 || signatureSpells.size() > 2) {
if (signatureSpells.isEmpty() || signatureSpells.size() > 2) {
invalid.put("Signature Spell", "Sideboard must contains 1 or 2 signature spells, but found: " + signatureSpells.size());
valid = false;
}

View file

@ -79,7 +79,7 @@ public class PennyDreadfulCommander extends Constructed {
}
}
if (deck.getSideboard().size() < 1 || deck.getSideboard().size() > 2) {
if (deck.getSideboard().isEmpty() || deck.getSideboard().size() > 2) {
invalid.put("Commander", "Sideboard must contain only the commander(s)");
valid = false;
} else {