Class ReduceValueProvider
java.lang.Object
net.demilich.metastone.game.spells.desc.valueprovider.ValueProvider
net.demilich.metastone.game.spells.desc.valueprovider.ReduceValueProvider
- All Implemented Interfaces:
Serializable
,HasDesc<ValueProviderDesc>
Performs
ValueProviderArg.OPERATION
on the values returned by ValueProviderArg.VALUE1
applied to each
entity resolved by ValueProviderArg.TARGET
.
If a filter is specified in ValueProviderArg.FILTER
, apply it to the list of entities resolved by the ValueProviderArg.TARGET
.
Specifying an attribute ValueProviderArg.ATTRIBUTE
is a shorthand for a "value1"
set to an AttributeValueProvider
with the specified attribute.
If a ValueProviderArg.VALUE2
is specified and the number of resolve target entities is zero, returns this
value.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ValueProviderDesc
create
(EntityReference target, Attribute attribute, EntityFilter filter, AlgebraicOperation operation) static ValueProviderDesc
create
(EntityReference target, ValueProviderDesc value1, EntityFilter filter, AlgebraicOperation operation) protected int
provideValue
(GameContext context, Player player, Entity target, Entity host) Methods inherited from class net.demilich.metastone.game.spells.desc.valueprovider.ValueProvider
getDesc, getValue, setDesc
-
Constructor Details
-
ReduceValueProvider
-
-
Method Details
-
create
public static ValueProviderDesc create(EntityReference target, Attribute attribute, EntityFilter filter, AlgebraicOperation operation) -
create
public static ValueProviderDesc create(EntityReference target, ValueProviderDesc value1, EntityFilter filter, AlgebraicOperation operation) -
provideValue
- Specified by:
provideValue
in classValueProvider
-