mirror of
https://github.com/correl/mage.git
synced 2024-12-26 19:16:54 +00:00
Fixed bloated error messages on commander deck check;
This commit is contained in:
parent
07cf5201ba
commit
2f04a0d979
3 changed files with 17 additions and 6 deletions
|
@ -166,6 +166,12 @@ public class Commander extends Constructed {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// no needs in cards check on wrong commanders
|
||||||
|
if (!valid) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
for (Card card : deck.getCards()) {
|
for (Card card : deck.getCards()) {
|
||||||
if (!cardHasValidColor(colorIdentity, card)) {
|
if (!cardHasValidColor(colorIdentity, card)) {
|
||||||
invalid.put(card.getName(), "Invalid color (" + colorIdentity.toString() + ')');
|
invalid.put(card.getName(), "Invalid color (" + colorIdentity.toString() + ')');
|
||||||
|
|
|
@ -67,8 +67,6 @@ public class FreeformCommander extends Constructed {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
generateFreeformHash();
|
|
||||||
|
|
||||||
if (deck.getSideboard().size() < 1 || deck.getSideboard().size() > 2) {
|
if (deck.getSideboard().size() < 1 || deck.getSideboard().size() > 2) {
|
||||||
invalid.put("Commander", "Sideboard must contain only the commander(s)");
|
invalid.put("Commander", "Sideboard must contain only the commander(s)");
|
||||||
valid = false;
|
valid = false;
|
||||||
|
@ -116,6 +114,11 @@ public class FreeformCommander extends Constructed {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// no needs in cards check on wrong commanders
|
||||||
|
if (!valid) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
for (Card card : deck.getCards()) {
|
for (Card card : deck.getCards()) {
|
||||||
if (!cardHasValidColor(colorIdentity, card)) {
|
if (!cardHasValidColor(colorIdentity, card)) {
|
||||||
invalid.put(card.getName(), "Invalid color (" + colorIdentity.toString() + ')');
|
invalid.put(card.getName(), "Invalid color (" + colorIdentity.toString() + ')');
|
||||||
|
@ -142,8 +145,4 @@ public class FreeformCommander extends Constructed {
|
||||||
|| cardColor.isRed() && !commander.isRed()
|
|| cardColor.isRed() && !commander.isRed()
|
||||||
|| cardColor.isWhite() && !commander.isWhite());
|
|| cardColor.isWhite() && !commander.isWhite());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void generateFreeformHash() {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,6 +124,12 @@ public class PennyDreadfulCommander extends Constructed {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// no needs in cards check on wrong commanders
|
||||||
|
if (!valid) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
for (Card card : deck.getCards()) {
|
for (Card card : deck.getCards()) {
|
||||||
if (!cardHasValidColor(colorIdentity, card)) {
|
if (!cardHasValidColor(colorIdentity, card)) {
|
||||||
invalid.put(card.getName(), "Invalid color (" + colorIdentity.toString() + ')');
|
invalid.put(card.getName(), "Invalid color (" + colorIdentity.toString() + ')');
|
||||||
|
|
Loading…
Reference in a new issue