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 TypeMethodDescriptionvoidonBattleResult(BattleResult result) Notifies the UI of each turn's result so it can update HP bars and messages.voidonBattleStart(Entity entityA, Entity entityB) Notifies when a battle starts; the UI should create a BattleScene.voidonGameOver(Player winner) Notifies when the game ends.voidonItemPickedUp(Player player) Notifies when a player picks up an item.voidonPlayerMoved(Player player, int row, int col) Notifies when a player successfully moves.voidonRoundEnd(int round) Notifies when a map round ends.voidonStateChanged(GameState newState) Notifies when the GameState changes.voidonTomeApplied(Player player, String effectDescription) Notifies when a TomeItem is applied to the winner after defeating a Goblin.voidonZoneShrunk(int newRadius) Notifies when the zone shrinks.
-
Method Details
-
onStateChanged
Notifies when the GameState changes.- Parameters:
newState- The new state
-
onBattleStart
-
onBattleResult
Notifies the UI of each turn's result so it can update HP bars and messages.- Parameters:
result- Result of this turn
-
onPlayerMoved
Notifies when a player successfully moves.- Parameters:
player- The player who movedrow- New rowcol- New column
-
onZoneShrunk
void onZoneShrunk(int newRadius) Notifies when the zone shrinks.- Parameters:
newRadius- New radius of the safe zone
-
onGameOver
Notifies when the game ends.- Parameters:
winner- The winner, ornullin case of a draw
-
onItemPickedUp
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
-