Skip to content

Commit

Permalink
Removed commented out code and bad comments etc in WaveTask.
Browse files Browse the repository at this point in the history
  • Loading branch information
max9753 committed Oct 16, 2023
1 parent f2c1398 commit c2b5555
Showing 1 changed file with 0 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
package com.csse3200.game.components.tasks.waves;

import com.badlogic.gdx.audio.Music;
import com.badlogic.gdx.audio.Sound;
import com.csse3200.game.ai.tasks.DefaultTask;
import com.csse3200.game.ai.tasks.PriorityTask;
import com.csse3200.game.ai.tasks.Task;
import com.csse3200.game.services.GameTime;
import com.csse3200.game.services.ResourceService;
import com.csse3200.game.services.ServiceLocator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;

public class WaveTask extends DefaultTask implements PriorityTask {
private static final Logger logger = LoggerFactory.getLogger(WaveTask.class);
private LevelWaves level;
Expand All @@ -21,10 +17,6 @@ public class WaveTask extends DefaultTask implements PriorityTask {
private long nextWaveAt = 0;
private int currentWaveIndex = 0;
private boolean waveInProgress;
private float startTime = 0;
private float endTime = 0;
private final float INITIAL_WAIT_INTERVAL = 10;
private final int SPAWNING_INTERVAL = 10;

private static final String[] waveSounds = {
"sounds/waves/wave-start/Wave_Start_Alarm.ogg",
Expand Down Expand Up @@ -83,7 +75,6 @@ public void start() {
this.currentWave = level.getWave(currentWaveIndex);
ServiceLocator.getWaveService().setEnemyCount(currentWave.getSize());
logger.info("Wave {} starting with {} enemies", currentWaveIndex, ServiceLocator.getWaveService().getEnemyCount());
// endTime = globalTime.getTime() + (SPAWNING_INTERVAL * 1000);
}

/**
Expand All @@ -101,7 +92,6 @@ public void update() {

} else {
// Spawn the next wave
// logger.info("No enemies remaining, begin next wave");
if (nextWaveAt == 0) {
logger.info("Next wave in 10 seconds");
this.waveEnd.play();
Expand All @@ -121,16 +111,11 @@ public void update() {
this.currentWave = this.level.getWave(currentWaveIndex);
ServiceLocator.getWaveService().setEnemyCount(currentWave.getSize());
logger.info("Next wave {} starting with {} enemies", currentWaveIndex, ServiceLocator.getWaveService().getEnemyCount());
//endTime = globalTime.getTime() + (SPAWNING_INTERVAL * 1000L); // reset end time
}
}
}

} else {
//logger.info("{} enemies remaining in wave {}", ServiceLocator.getWaveService().getEnemyCount(), currentWaveIndex);
//logger.info("WAVE SERVICE NUMBER: Wave Number {}",ServiceLocator.getWaveService().getWaveCount());
//logger.info("NEXT WAVE AT {}", ServiceLocator.getWaveService().getNextWaveTime());
//logger.info("TIME IS {}", ServiceLocator.getTimeSource().getTime());
if (waveInProgress) {
this.level.spawnWave();
}
Expand Down

0 comments on commit c2b5555

Please sign in to comment.