GUI, deck: improved invalid deck information (added more details in wrong commander color);

This commit is contained in:
Oleg Agafonov 2025-05-24 00:20:54 +04:00
parent 8649869ed4
commit 3f1a02aa03
3 changed files with 5 additions and 5 deletions

View file

@ -88,13 +88,13 @@ public abstract class AbstractCommander extends Constructed {
boolean valid = true;
for (Card card : deck.getCards()) {
if (!ManaUtil.isColorIdentityCompatible(colorIdentity, card.getColorIdentity())) {
addError(DeckValidatorErrorType.OTHER, card.getName(), "Invalid color (" + colorIdentity.toString() + ')', true);
addError(DeckValidatorErrorType.OTHER, card.getName(), "Invalid color (need " + colorIdentity + ", but get " + card.getColorIdentity() + ")", true);
valid = false;
}
}
for (Card card : deck.getSideboard()) {
if (!ManaUtil.isColorIdentityCompatible(colorIdentity, card.getColorIdentity())) {
addError(DeckValidatorErrorType.OTHER, card.getName(), "Invalid color (" + colorIdentity.toString() + ')', true);
addError(DeckValidatorErrorType.OTHER, card.getName(), "Invalid color (need " + colorIdentity + ", but get " + card.getColorIdentity() + ")", true);
valid = false;
}
}

View file

@ -122,7 +122,7 @@ public class Brawl extends Constructed {
&& !(colorIdentity.isColorless()
&& basicsInDeck.size() == 1
&& basicsInDeck.contains(card.getName()))) {
addError(DeckValidatorErrorType.OTHER, card.getName(), "Invalid color (" + colorIdentity.toString() + ')', true);
addError(DeckValidatorErrorType.OTHER, card.getName(), "Invalid color (need " + colorIdentity + ", but get " + card.getColorIdentity() + ")", true);
valid = false;
}
}
@ -131,7 +131,7 @@ public class Brawl extends Constructed {
&& !(colorIdentity.isColorless()
&& basicsInDeck.size() == 1
&& basicsInDeck.contains(card.getName()))) {
addError(DeckValidatorErrorType.OTHER, card.getName(), "Invalid color (" + colorIdentity.toString() + ')', true);
addError(DeckValidatorErrorType.OTHER, card.getName(), "Invalid color (need " + colorIdentity + ", but get " + card.getColorIdentity() + ")", true);
valid = false;
}
}

View file

@ -189,7 +189,7 @@ public class Oathbreaker extends Constructed {
for (Card card : deck.getCards()) {
if (!ManaUtil.isColorIdentityCompatible(allCommandersColor, card.getColorIdentity())) {
addError(DeckValidatorErrorType.OTHER, card.getName(), "Invalid color (" + card.getColorIdentity() + ')', true);
addError(DeckValidatorErrorType.OTHER, card.getName(), "Invalid color (need " + allCommandersColor + ", but get " + card.getColorIdentity() + ")", true);
valid = false;
}
}