Interface GameEventListener

All Known Implementing Classes:
GameController

public interface GameEventListener
Interface that the UI must implement to receive events from GameManager. Separating the Model from the UI allows game logic to be tested without a real screen.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Notifies the UI of each turn's result so it can update HP bars and messages.
    void
    onBattleStart(Entity entityA, Entity entityB)
    Notifies when a battle starts; the UI should create a BattleScene.
    void
    Notifies when the game ends.
    void
    Notifies when a player picks up an item.
    void
    onPlayerMoved(Player player, int row, int col)
    Notifies when a player successfully moves.
    void
    onRoundEnd(int round)
    Notifies when a map round ends.
    void
    Notifies when the GameState changes.
    void
    onTomeApplied(Player player, String effectDescription)
    Notifies when a TomeItem is applied to the winner after defeating a Goblin.
    void
    onZoneShrunk(int newRadius)
    Notifies when the zone shrinks.
  • Method Details

    • onStateChanged

      void onStateChanged(GameState newState)
      Notifies when the GameState changes.
      Parameters:
      newState - The new state
    • onBattleStart

      void onBattleStart(Entity entityA, Entity entityB)
      Notifies when a battle starts; the UI should create a BattleScene.
      Parameters:
      entityA - Entity on side A
      entityB - Entity on side B
    • onBattleResult

      void onBattleResult(BattleResult result)
      Notifies the UI of each turn's result so it can update HP bars and messages.
      Parameters:
      result - Result of this turn
    • onPlayerMoved

      void onPlayerMoved(Player player, int row, int col)
      Notifies when a player successfully moves.
      Parameters:
      player - The player who moved
      row - New row
      col - New column
    • onZoneShrunk

      void onZoneShrunk(int newRadius)
      Notifies when the zone shrinks.
      Parameters:
      newRadius - New radius of the safe zone
    • onGameOver

      void onGameOver(Player winner)
      Notifies when the game ends.
      Parameters:
      winner - The winner, or null in case of a draw
    • onItemPickedUp

      void onItemPickedUp(Player player)
      Notifies when a player picks up an item.
      Parameters:
      player - The player who picked up the item
    • onRoundEnd

      void onRoundEnd(int round)
      Notifies when a map round ends.
      Parameters:
      round - The current round number
    • onTomeApplied

      void onTomeApplied(Player player, String effectDescription)
      Notifies when a TomeItem is applied to the winner after defeating a Goblin.
      Parameters:
      player - The player who received the tome
      effectDescription - Description of the stat boost