From 5c018bfeb45f48c11d7e46a0c268a6502b4f140f Mon Sep 17 00:00:00 2001 From: Shivam Date: Tue, 3 Oct 2023 01:40:15 +1000 Subject: [PATCH] Fixed failing tests --- .../game/components/maingame/UIElementsDisplay.java | 9 ++++++++- .../main/com/csse3200/game/screens/MainGameScreen.java | 1 + .../src/main/com/csse3200/game/services/WaveService.java | 1 - 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/source/core/src/main/com/csse3200/game/components/maingame/UIElementsDisplay.java b/source/core/src/main/com/csse3200/game/components/maingame/UIElementsDisplay.java index 644bedcb8..471739f95 100644 --- a/source/core/src/main/com/csse3200/game/components/maingame/UIElementsDisplay.java +++ b/source/core/src/main/com/csse3200/game/components/maingame/UIElementsDisplay.java @@ -152,7 +152,6 @@ public void changed(ChangeEvent changeEvent, Actor actor) { */ public void updateMobCount() { remainingMobsButton.setText("Mobs:" + ServiceLocator.getWaveService().getEnemyCount()); - updateTimerButton(); } /** @@ -199,4 +198,12 @@ public void dispose() { buttonTable.clear(); towerTable.clear(); } + + public TextButton getRemainingMobsButton() { + return getRemainingMobsButton(); + } + + public TextButton getTimerButton() { + return timerButton; + } } diff --git a/source/core/src/main/com/csse3200/game/screens/MainGameScreen.java b/source/core/src/main/com/csse3200/game/screens/MainGameScreen.java index 0ff767a61..332146d13 100644 --- a/source/core/src/main/com/csse3200/game/screens/MainGameScreen.java +++ b/source/core/src/main/com/csse3200/game/screens/MainGameScreen.java @@ -213,6 +213,7 @@ public void render(float delta) { } ServiceLocator.getWaveService().getDisplay().updateTimerButton(); + ServiceLocator.getWaveService().getDisplay().updateMobCount(); renderer.render(); } diff --git a/source/core/src/main/com/csse3200/game/services/WaveService.java b/source/core/src/main/com/csse3200/game/services/WaveService.java index a8416b11f..0e50a7fc1 100644 --- a/source/core/src/main/com/csse3200/game/services/WaveService.java +++ b/source/core/src/main/com/csse3200/game/services/WaveService.java @@ -52,7 +52,6 @@ public int getEnemyCount() { */ public void updateEnemyCount() { enemyCount -= 1; - display.updateMobCount(); logger.info("{} enemies remaining in wave", getEnemyCount()); }