Class LevelWaves
java.lang.Object
com.csse3200.game.entities.Entity
com.csse3200.game.components.tasks.waves.LevelWaves
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a wave to the level and increment the total number of wavesintGet the current mob indexintGet the total number of waves in this levelfloatlonggetWave(int index) Retrieve a wave at an index in the listintGet the current wave indexgetWaves()voidsetWaveIndex(int index) Set the wave indexvoidSpawn the wave and all the associated mobs for that wavetoString()Methods inherited from class com.csse3200.game.entities.Entity
addComponent, create, dispose, earlyUpdate, equals, getCenterPosition, getComponent, getEvents, getFlagForDelete, getId, getLayer, getName, getPosition, getScale, hashCode, removeComponent, scaleHeight, scaleWidth, setEnabled, setFlagForDelete, setLayer, setPosition, setPosition, setPosition, setScale, setScale, update
-
Constructor Details
-
LevelWaves
public LevelWaves(int spawnDelay) Constructor for the LevelWaves class- Parameters:
spawnDelay- time to elapse between each wave
-
-
Method Details
-
addWave
Add a wave to the level and increment the total number of waves- Parameters:
wave- to be added
-
getWave
Retrieve a wave at an index in the list- Parameters:
index- wave number to be retireved- Returns:
- instance of a wave class
-
spawnWave
public void spawnWave()Spawn the wave and all the associated mobs for that wave -
setWaveIndex
public void setWaveIndex(int index) Set the wave index- Parameters:
index-
-
getNumWaves
public int getNumWaves()Get the total number of waves in this level- Returns:
- number of waves in the level
-
getSpawnDelay
public float getSpawnDelay() -
getStartTime
public long getStartTime() -
getMobIndex
public int getMobIndex()Get the current mob index- Returns:
- mob index
-
getWaveIndex
public int getWaveIndex()Get the current wave index- Returns:
- wave index
-
getWaves
-
toString
-