Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleaned up code smells #287

Merged
merged 3 commits into from
Oct 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,13 @@
import com.csse3200.game.services.ServiceLocator;
import com.csse3200.game.ui.ButtonFactory;
import com.csse3200.game.ui.UIComponent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.swing.event.ChangeEvent;
import java.security.Provider;


/**
* Displays a button to represent the remaining mobs left in the current wave and a button to skip to the next wave.
*/
public class UIElementsDisplay extends UIComponent {
private static final Logger logger = LoggerFactory.getLogger(UIElementsDisplay.class);
private static final float Z_INDEX = 2f;
private final Table buttonTable = new Table();
private final Table timerTable = new Table();
private TextButton remainingMobsButton;
private TextButton timerButton;

Expand Down Expand Up @@ -97,11 +89,6 @@ public void updateTimerButton() {
int totalSecs = (int) ((ServiceLocator.getWaveService().getNextWaveTime()
- ServiceLocator.getTimeSource().getTime()) / 1000);

// TODO : THESE SHOULD BE REMOVED AND PLACED WHEREVER THE BOSS MOB GETS SPAWNED
if (totalSecs % 20 == 0) {
ServiceLocator.getMapService().shakeCameraMap();
ServiceLocator.getMapService().shakeCameraGrid();
}
int seconds = totalSecs % 60;
int minutes = (totalSecs % 3600) / 60;
String finalTime = String.format("%02d:%02d", minutes, seconds);
Expand Down