mirror of
https://github.com/correl/mage.git
synced 2024-11-25 03:00:11 +00:00
added an additional subtype verification test
This commit is contained in:
parent
9072abbbcc
commit
07e1dff10c
2 changed files with 20 additions and 0 deletions
|
@ -1254,6 +1254,20 @@ public class VerifyCardDataTest {
|
|||
expected.removeIf(subtypesToIgnore::contains);
|
||||
}
|
||||
|
||||
for (SubType subType : card.getSubtype()) {
|
||||
if (!subType.isCustomSet() && !subType.canGain(card)) {
|
||||
String cardTypeString = card
|
||||
.getCardType()
|
||||
.stream()
|
||||
.map(CardType::toString)
|
||||
.reduce((a, b) -> a + " " + b)
|
||||
.orElse("");
|
||||
fail(card, "subtypes", "card has subtype "
|
||||
+ subType.getDescription() + " (" + subType.getSubTypeSet() + ')'
|
||||
+ " that doesn't match its card type(s) (" + cardTypeString + ')');
|
||||
}
|
||||
}
|
||||
|
||||
if (!eqSet(actual, expected)) {
|
||||
fail(card, "subtypes", actual + " != " + expected);
|
||||
}
|
||||
|
|
|
@ -544,6 +544,10 @@ public enum SubType {
|
|||
return "AEIOUaeiou".indexOf(c) != -1;
|
||||
}
|
||||
|
||||
public boolean isCustomSet() {
|
||||
return customSet;
|
||||
}
|
||||
|
||||
public static SubType fromString(String value) {
|
||||
for (SubType st : SubType.values()) {
|
||||
if (st.toString().equals(value)) {
|
||||
|
@ -581,6 +585,8 @@ public enum SubType {
|
|||
return mageObject.isArtifact();
|
||||
case PlaneswalkerType:
|
||||
return mageObject.isPlaneswalker();
|
||||
case SpellType:
|
||||
return mageObject.isInstantOrSorcery();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue