Restrictions for Card.isValidCard
 Posted: 28 Aug 2010, 20:40
Posted: 28 Aug 2010, 20:40Card.isValidCard takes a string array as a parameter. Each element follows the form:
CardType{.restriction}{+furtherRestriction}
The restrictions are optional.
CardType may be any type, generally the supertypes like Creature, Artifact, Enchantment, Land, etc. However, it could also be Elf or Goblin... though that would also include Elf Enchantments, for example. To specify an Elf Creature, then it should be "Creature.Elf". "Permanent" represents any permanent....
Restrictions other than type that are interpreted: (case sensitive)
Examples:
"Artifact or Enchantment" would be represented as a 2 element string array one element is "Artifact" the other "Enchantment"
"non-black, non-artifact creature" would be represented as a 1 element array - "Creature.nonBlack+nonArtifact"
"creature with power 2 or less" would be "Creature.powerLE2"
"nonbasic land" is "Land.nonBasic"
"creature with flying" is "Creature.withFlying"
			CardType{.restriction}{+furtherRestriction}
The restrictions are optional.
CardType may be any type, generally the supertypes like Creature, Artifact, Enchantment, Land, etc. However, it could also be Elf or Goblin... though that would also include Elf Enchantments, for example. To specify an Elf Creature, then it should be "Creature.Elf". "Permanent" represents any permanent....
Restrictions other than type that are interpreted: (case sensitive)
- Color, nonColor (White, nonWhite, etc)
- Colorless, nonColorless
- Multicolor, nonMulticolor
- with{Keyword}, without{Keyword}
- tapped, untapped
- enchanted, unenchanted, enchanting
- token, nonToken
- power{cmp}{X or #}
- toughness{cmp}{X or #}
- cmc{cmp}{X or #} {cmp} is a comparator:
- LT - Less Than
- LE - Less than or Equal
- EQ - EQual
- GE - Greater than or Equal
- GT - Greater Than
Examples:
"Artifact or Enchantment" would be represented as a 2 element string array one element is "Artifact" the other "Enchantment"
"non-black, non-artifact creature" would be represented as a 1 element array - "Creature.nonBlack+nonArtifact"
"creature with power 2 or less" would be "Creature.powerLE2"
"nonbasic land" is "Land.nonBasic"
"creature with flying" is "Creature.withFlying"