Package wizardhub


package wizardhub
This library contains the HotStone Wizard Library which allows hero powers and minion effects to be formulated and executed using a fluent API.

Example 1: Deal 1 damage to opponent hero.
Coded as: new EffectWizard(targetGame).forOpponent().forHero().doChangeHealthOrRemove(-1);

Example 2: Add +1 attack to random minion.
Coded as: int index = (generate a random integer in range 0..fieldSize of player in turn); new EffectWizard(targetGame).forMe().forMinonAt(index).doChangeAttack(+1);

That is, the syntax is always three parts:
  1. the new() part in which the target game is set;
  2. a set of forX() methods that states which elements of the game to target;
  3. and a final doX() method that executes the effect.

In case the effect is not wellformed (like missing a forMe() or forOpponent()) then an exception is cast when doX() is called.

As this library is independent of any HotStone specific classes, you need to use Adapter to effect your particular HotStone game. You do this by implementing an Adapter class which implements the HotStoneGameTarget interface and delegate calls to your particular HotStone game instance.

Developed by Henrik Bærbak Christensen, Aarhus University, 2022.

  • Class
    Description
    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.
    An Adapter 'Target' role interface for a HotStone game.