Test framework: added commands for real time checks/assertions:

* new checks: color, subtype, ability, PT, permanent and hand count;
 * more info in #4936;
This commit is contained in:
Oleg Agafonov 2018-05-14 02:31:19 +04:00
parent f30c0a7054
commit 4851ba9e84
5 changed files with 344 additions and 106 deletions

View file

@ -4,6 +4,7 @@ import java.util.Arrays;
import java.util.EnumSet;
import java.util.Set;
import java.util.stream.Collectors;
import mage.util.SubTypeList;
public enum SubType {
@ -328,17 +329,16 @@ public enum SubType {
TROOPER("Trooper", SubTypeSet.CreatureType, true), // Star Wars
TRILOBITE("Trilobite", SubTypeSet.CreatureType),
TWILEK("Twi'lek", SubTypeSet.CreatureType, true), // Star Wars
// U
UGNAUGHT("Ugnaught", SubTypeSet.CreatureType, true),
UNICORN("Unicorn", SubTypeSet.CreatureType),
//V
// V
VAMPIRE("Vampire", SubTypeSet.CreatureType),
VEDALKEN("Vedalken", SubTypeSet.CreatureType),
VIASHINO("Viashino", SubTypeSet.CreatureType),
VILLAIN("Villain", SubTypeSet.CreatureType, true), // Unstable
VOLVER("Volver", SubTypeSet.CreatureType),
//W
// W
WALL("Wall", SubTypeSet.CreatureType),
WARRIOR("Warrior", SubTypeSet.CreatureType),
WEEQUAY("Weequay", SubTypeSet.CreatureType, true),
@ -429,6 +429,16 @@ public enum SubType {
return description;
}
public static SubType fromString(String value) {
for (SubType st : SubType.values()) {
if (st.toString().equals(value)) {
return st;
}
}
throw new IllegalArgumentException("Can''t find subtype enum value: " + value);
}
public static SubType byDescription(String subType) {
for (SubType s : values()) {
if (s.getDescription().equals(subType)) {