Package wizardhub

Interface HotStoneGameTarget


public interface HotStoneGameTarget
An Adapter 'Target' role interface for a HotStone game.

The EffectWizard class will modify a HotStone game via this Target role. You must implement an Adapter that implements this interface and delegate all method calls to your particular HotStone Game implementation.

Example sketch:
   public class MyAdapter implements HotStoneGameTarget {
     private StandardGame decoratee;
     ...
     public int getThePlayerInTurn() {
       Player p = decoratee.getPlayerInTurn();
       if (p==Player.FINDUS) return 0;
       return 1;
     }
     [etc...]
   }
 

As this interface does not know any types of the HotStone game, some encoding is necessary:

Player FINDUS and PEDDERSEN is encoded as an integer value: 0 is Findus and 1 is Peddersen.

FieldIndex follows the normal HotStone conventions: index 0 is the leftmost minion.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    deltaAttackMinion(int playerIndex, int fieldIndex, int attackDelta)
    Increase/reduce the attack of a minion in the field, if the resulting attack value is less than or equal 0 then set it to 0.
    void
    deltaHealthHero(int playerIndex, int healthDelta)
    Increase/Reduce health of a hero, if the resulting hero health is less than or equal to 0 then force the game to end with a winner.
    void
    deltaHealthOrRemoveMinion(int playerIndex, int fieldIndex, int healthDelta)
    Increase/reduce the health of a minion in the field, or remove it if health is less than or equal to 0.
    void
    drawCard(int playerIndex)
    Draw a card from the given player's hand into the deck.
    int
    getSizeOfField(int playerIndex)
    Get the number of minions on the field for the given player.
    int
    Get the player currently in turn.
    void
    setTauntCategoryMinion(int playerIndex, int fieldIndex, boolean isTaunt)
    Set/unset the taunt category of a minion.
  • Method Details

    • getThePlayerInTurn

      int getThePlayerInTurn()
      Get the player currently in turn.
      Returns:
      0 = Findus or 1 = Peddersen
    • getSizeOfField

      int getSizeOfField(int playerIndex)
      Get the number of minions on the field for the given player.
      Parameters:
      playerIndex - which player, either 0 or 1
      Returns:
      the number of minions on this players field
    • deltaHealthOrRemoveMinion

      void deltaHealthOrRemoveMinion(int playerIndex, int fieldIndex, int healthDelta)
      Increase/reduce the health of a minion in the field, or remove it if health is less than or equal to 0. Note: You can emulate a 'removeMinion(player, fieldindex)' by calling with, say, -10 for healthDelta.
      Parameters:
      playerIndex - which player, either 0 or 1
      fieldIndex - index on the field 0..max-1
      healthDelta - the delta to apply to health, may be both positive or negative.
    • deltaAttackMinion

      void deltaAttackMinion(int playerIndex, int fieldIndex, int attackDelta)
      Increase/reduce the attack of a minion in the field, if the resulting attack value is less than or equal 0 then set it to 0.
      Parameters:
      playerIndex - which player, either 0 or 1
      fieldIndex - index on the field 0..max-1
      attackDelta - the delta to apply to the attack
    • setTauntCategoryMinion

      void setTauntCategoryMinion(int playerIndex, int fieldIndex, boolean isTaunt)
      Set/unset the taunt category of a minion.
      Parameters:
      playerIndex - which player, either 0 or 1
      fieldIndex - index on the field 0..max-1
      isTaunt - if true then make the minion a taunt minion, if false, remove taunt ('silence' in HearthStone)
    • deltaHealthHero

      void deltaHealthHero(int playerIndex, int healthDelta)
      Increase/Reduce health of a hero, if the resulting hero health is less than or equal to 0 then force the game to end with a winner.
      Parameters:
      playerIndex - which player, either 0 or 1
      healthDelta - the delta to apply to the hero health
    • drawCard

      void drawCard(int playerIndex)
      Draw a card from the given player's hand into the deck.
      Parameters:
      playerIndex - which player, either 0 or 1