Class CardFilter
java.lang.Object
net.demilich.metastone.game.spells.desc.filter.EntityFilter
net.demilich.metastone.game.spells.desc.filter.CardFilter
- All Implemented Interfaces:
Serializable
,HasDesc<EntityFilterDesc>
Filters entities based on various properties of their source cards.
The supported properties are:
EntityFilterArg.CARD_TYPE
.EntityFilterArg.RACE
.EntityFilterArg.HERO_CLASS
, including the special hero classesHeroClass.OPPONENT
andHeroClass.SELF
.EntityFilterArg.HERO_CLASSES
to check if the entity's hero class matches any in the list.EntityFilterArg.MANA_COST
for the entity's base mana cost. UseManaCostFilter
for its current cost instead.EntityFilterArg.RARITY
.EntityFilterArg.CARD_SET
.EntityFilterArg.ATTRIBUTE
, including anEntityFilterArg.OPERATION
against it. For attack and health, useAttributeFilter
.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic CardFilter
create
(com.hiddenswitch.spellsource.rpc.Spellsource.CardTypeMessage.CardType cardType) static CardFilter
boolean
protected boolean
test
(GameContext context, Player player, Entity entity, Entity host) The subclasses of this class implement this method to actually perform the logic of the filtering.Methods inherited from class net.demilich.metastone.game.spells.desc.filter.EntityFilter
getArg, getDesc, getTargetedEntities, hasArg, matcher, matches, setDesc
-
Constructor Details
-
CardFilter
-
-
Method Details
-
test
Description copied from class:EntityFilter
The subclasses of this class implement this method to actually perform the logic of the filtering. Observe that results from filtering other entities are not available here; this function is stateless in the sense that an earlier acceptance or rejection of an entity cannot influence the acceptance or rejection of a current entity.- Specified by:
test
in classEntityFilter
- Returns:
-
equals
- Overrides:
equals
in classEntityFilter
-