Package wizardhub
Class EffectWizard
java.lang.Object
wizardhub.EffectWizard
A Bloch Builder for Effects in HotStone: You build
an expression of what you want to cause of effects
on a HotStone game, and then execute it using one of the
doX() methods.
To interface any HotStone game an adapter via the provided interface 'HotStoneGameTarget' must be provided at construction time.
Example of usage:// increase health of MY minion at field index 0 by +2 new EffectWizard(target).forMe().forMinionAt(0).doChangeHealthOrRemove(+2); // reduce opponent hero's health by 10 new EffectWizard(target).forOpponent().forHero().doChangeHealthOrRemove(-10);
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionEffectWizard(HotStoneGameTarget gameTarget) Construct a wizard for effects on a HotStone game. -
Method Summary
Modifier and TypeMethodDescriptionvoiddoChangeAttack(int deltaAttack) Execute an attack change effect.voiddoChangeHealthOrRemove(int deltaHealth) Execute a health change effect.voidExecute a draw card effectvoiddoSetTauntCategory(boolean isTaunt) Execute a taunt category set/unset effect.forAll()Set the wizard to an effect for all minions.forHero()Set the wizard to do an effect on a hero.forMe()Set the wizard to do an effect on the player in turn.forMinionAt(int fieldIndex) Set the wizard to do an effect on a minion at a specific index on the field.Set the wizard to do an effect on the opponent player (player NOT in turn).toString()Return a string representing the wizard's state.
-
Field Details
-
WIZARD_VERSION
Currently released version of EffectWizard
-
-
Constructor Details
-
EffectWizard
Construct a wizard for effects on a HotStone game.- Parameters:
gameTarget- The role of Target in the Adapter pattern. Make an Adapter which implements this interface, and delegate calls to your own HotStone Game instance to use the Wizard.
-
-
Method Details
-
forMe
Set the wizard to do an effect on the player in turn.- Returns:
- this object, for further building.
-
forOpponent
Set the wizard to do an effect on the opponent player (player NOT in turn).- Returns:
- this object, for further building.
-
forMinionAt
Set the wizard to do an effect on a minion at a specific index on the field.- Parameters:
fieldIndex- index of the minion on the field- Returns:
- this object, for further building.
-
forAll
Set the wizard to an effect for all minions.- Returns:
- this object, for further building.
-
forHero
Set the wizard to do an effect on a hero.- Returns:
- this object, for further building.
-
doChangeHealthOrRemove
public void doChangeHealthOrRemove(int deltaHealth) Execute a health change effect.- Parameters:
deltaHealth- the delta to apply to the set minion/hero. Can be both positive and negative.
-
doSetTauntCategory
public void doSetTauntCategory(boolean isTaunt) Execute a taunt category set/unset effect.- Parameters:
isTaunt- set the minion to be a taunt minion if true, otherwise remove taunt.
-
doChangeAttack
public void doChangeAttack(int deltaAttack) Execute an attack change effect.- Parameters:
deltaAttack- the delta to apply to the set minion. Can be both positive and negative.
-
doDrawCard
public void doDrawCard()Execute a draw card effect -
toString
Return a string representing the wizard's state.
-