Class NumberOfCopiesCondition
java.lang.Object
net.demilich.metastone.game.spells.desc.condition.Condition
net.demilich.metastone.game.spells.desc.condition.NumberOfCopiesCondition
- All Implemented Interfaces:
Serializable,HasDesc<ConditionDesc>
- Direct Known Subclasses:
HighlanderDeckCondition
Evaluates to
true when the number of distinct card IDs in the ConditionArg.TARGET when filtered by
ConditionArg.FILTER passes the ConditionArg.OPERATION with ConditionArg.VALUE.
For example, a condition that is true when there are two or less copies of all cards:
{
"description": "Decks can't have more than 2 copies of a card",
"class": "NumberOfCopiesCondition",
"target": "FRIENDLY_DECK",
"operation": "LESS_OR_EQUAL",
"value": 2
}
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanisFulfilled(GameContext context, Player player, ConditionDesc desc, Entity source, Entity target) protected booleanWhentrue,ConditionArg.TARGETis evaluated instead of being interpreted by the subclass, replacingtargetif it is specified.protected booleanMethods inherited from class net.demilich.metastone.game.spells.desc.condition.Condition
equals, getDesc, hashCode, isFulfilled, isFulfilledForTarget, multipleTargetsEvaluatedAsAnd, multipleTargetsEvaluatedAsOr, requiresAtLeastOneTarget, setDesc, singleTargetOnly
-
Constructor Details
-
NumberOfCopiesCondition
-
-
Method Details
-
isFulfilled
protected boolean isFulfilled(GameContext context, Player player, ConditionDesc desc, Entity source, Entity target) - Specified by:
isFulfilledin classCondition
-
targetConditionArgOverridesSuppliedTarget
protected boolean targetConditionArgOverridesSuppliedTarget()Description copied from class:ConditionWhentrue,ConditionArg.TARGETis evaluated instead of being interpreted by the subclass, replacingtargetif it is specified.When
false, onlytargetis passed.- Overrides:
targetConditionArgOverridesSuppliedTargetin classCondition- Returns:
-
usesFilter
protected boolean usesFilter()Description copied from class:Condition- Overrides:
usesFilterin classCondition- Returns:
-