Class EnemyWaves
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.enemy.EnemyWaves
Handles spawning enemies over multiple waves. Simplified: a fixed number of waves per trigger.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionEnemyWaves
(int maxWaves, GameArea area, Entity player) EnemyWaves
(GameArea area, Entity player) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks if all the waves in the current room have finished.int
Returns the maximum number of waves in the current room.float
Returns the scaling factor of the enemies in the next wave.long
Returns the time stamp of when the previous wave ended in the current room if no enemies are alive otherwise returns 0.int
Returns the wave number of the next wave in the current room.boolean
Checks if the current wave has finished.void
setMaxWaves
(int maxWaves) Sets the maximum number of waves in the current room.void
setScalingFactor
(float scalingFactor) Sets the scaling factor of the enemies in the next wave.void
setWaveEndTime
(long waveEndTime) Sets the time stamp of when the previous wave ended in the current roomvoid
setWaveNumber
(int waveNumber) Sets the wave number of the next wave in the current room.void
Start or resume wave logic.Methods inherited from class com.csse3200.game.components.Component
create, dispose, earlyUpdate, getEntity, getPrio, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
EnemyWaves
-
EnemyWaves
-
-
Method Details
-
startWave
public void startWave()Start or resume wave logic. If all waves previously finished, this restarts from wave 0. -
allWavesFinished
public boolean allWavesFinished()Checks if all the waves in the current room have finished.- Returns:
- True if all waves have finished, false otherwise.
-
isCurrentWaveFinished
public boolean isCurrentWaveFinished()Checks if the current wave has finished.- Returns:
- True if the current wave has finished, false otherwise.
-
getMaxWaves
public int getMaxWaves()Returns the maximum number of waves in the current room.- Returns:
- The maxWaves as an int.
-
getScalingFactor
public float getScalingFactor()Returns the scaling factor of the enemies in the next wave.- Returns:
- The scaling factor as a float.
-
getWaveNumber
public int getWaveNumber()Returns the wave number of the next wave in the current room.- Returns:
- The wave number as an int.
-
getWaveEndTime
public long getWaveEndTime()Returns the time stamp of when the previous wave ended in the current room if no enemies are alive otherwise returns 0.- Returns:
- The wave end time in milliseconds as a long.
-
setMaxWaves
public void setMaxWaves(int maxWaves) Sets the maximum number of waves in the current room.- Parameters:
maxWaves
- The maximum number of waves as an int.
-
setScalingFactor
public void setScalingFactor(float scalingFactor) Sets the scaling factor of the enemies in the next wave.- Parameters:
scalingFactor
- The scaling factor as a float.
-
setWaveNumber
public void setWaveNumber(int waveNumber) Sets the wave number of the next wave in the current room.- Parameters:
waveNumber
- The wave number as an int.
-
setWaveEndTime
public void setWaveEndTime(long waveEndTime) Sets the time stamp of when the previous wave ended in the current room- Parameters:
waveEndTime
- The wave end time in milliseconds as a long .
-