Class LevelWaves
java.lang.Object
com.csse3200.game.entities.Entity
com.csse3200.game.components.tasks.waves.LevelWaves
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a wave to the level and increment the total number of wavesint
Get the current mob indexint
Get the total number of waves in this levelfloat
long
getWave
(int index) Retrieve a wave at an index in the listint
Get the current wave indexgetWaves()
void
setWaveIndex
(int index) Set the wave indexvoid
Spawn 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
-