mirror of
https://github.com/magefree/mage.git
synced 2026-01-25 12:49:39 -08:00
change some size() comparisons, to isEmpty()
This commit is contained in:
parent
5ba206111a
commit
eb0cfc94f8
23 changed files with 35 additions and 36 deletions
|
|
@ -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");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue