Package wizardhub

Class EffectWizard

java.lang.Object
wizardhub.EffectWizard

public class EffectWizard extends Object
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 Details

    • WIZARD_VERSION

      public static String WIZARD_VERSION
      Currently released version of EffectWizard
  • Constructor Details

    • EffectWizard

      public EffectWizard(HotStoneGameTarget gameTarget)
      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

      public EffectWizard forMe()
      Set the wizard to do an effect on the player in turn.
      Returns:
      this object, for further building.
    • forOpponent

      public EffectWizard forOpponent()
      Set the wizard to do an effect on the opponent player (player NOT in turn).
      Returns:
      this object, for further building.
    • forMinionAt

      public EffectWizard forMinionAt(int fieldIndex)
      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

      public EffectWizard forAll()
      Set the wizard to an effect for all minions.
      Returns:
      this object, for further building.
    • forHero

      public EffectWizard 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

      public String toString()
      Return a string representing the wizard's state.
      Overrides:
      toString in class Object