Class EntityEqualsFilter
java.lang.Object
net.demilich.metastone.game.spells.desc.filter.EntityFilter
net.demilich.metastone.game.spells.desc.filter.EntityEqualsFilter
- All Implemented Interfaces:
Serializable
,HasDesc<EntityFilterDesc>
Matches an entity if the entity is in the list of entities returned by resolving the
EntityFilterArg.SECONDARY_TARGET
.
For example, to implement the text, "Choose a minion. It attacks a random friendly minion."
"spell": { "class": "DuelSpell", "target": "FRIENDLY_MINIONS", "filter": { "class": "EntityEqualsFilter", "secondaryTarget": "TARGET", "invert": true }, "randomTarget": true, "secondaryTarget": "TARGET" }Observe that the filter takes a
EntityFilterArg.SECONDARY_TARGET
of EntityReference.TARGET
, i.e., the
actual minion chosen. We want to choose a random target that does not include the minion chosen.- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic EntityFilter
create
(EntityReference equalTo) static EntityFilter
create
(EntityReference equalTo, boolean invert) 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
equals, getArg, getDesc, getTargetedEntities, hasArg, matcher, matches, setDesc
-
Constructor Details
-
EntityEqualsFilter
-
-
Method Details
-
create
-
create
-
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:
-