Class GameValueProvider
java.lang.Object
net.demilich.metastone.game.spells.desc.valueprovider.ValueProvider
net.demilich.metastone.game.spells.desc.valueprovider.GameValueProvider
- All Implemented Interfaces:
Serializable
,HasDesc<ValueProviderDesc>
Used to retrieve a variable calculated in a
MetaSpell
.
This value provider lets you "bake in" or calculate a value at one point of time, using it at a later point. This is especially useful for effects that deal damage based on the number of minions destroyed, for example; an earlier part of the spell destroyed the minions you need to count, so you can count how many minions were on the board before the destroy spell was run, and then see how many of those old ones still remain.
To retrieve the SpellArg.VALUE
from a MetaSpell
, use GameValue.SPELL_VALUE
:
{ "class": "MetaSpell", "value": { ... }, "spells": [ { "class": "DamageSpell", "value": { "class": "GameValueProvider", "gameValue": "SPELL_VALUE" } } ] }
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected 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
-
GameValueProvider
-
-
Method Details
-
provideValue
- Specified by:
provideValue
in classValueProvider
-