Package com.csse3200.game.services
Class WaveService
java.lang.Object
com.csse3200.game.services.WaveService
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Returns the number of enemy leftint
Returns the next lane number of a moblong
Returns time of the next wave.int
Returns the spawn delay between levelsint
Returns the game over stateboolean
Returns the game over statevoid
setEnemyCount
(int newLimit) Set the enemy limit.void
Set the level to be completed.void
setNextLane
(int lane) Sets the waveCountvoid
setNextWaveTime
(long nextWaveTime) Sets the next wave timestampvoid
setSpawnDelay
(int spawnDelay) Sets the spawn delay between levelsvoid
setWaveCount
(int waveCount) Sets the waveCountvoid
Updates enemy count If enemy count is 0, the game is over.
-
Constructor Details
-
WaveService
public WaveService()Constructor for the Wave Service
-
-
Method Details
-
setEnemyCount
public void setEnemyCount(int newLimit) Set the enemy limit. During instantiation, limit defaults to 0.- Parameters:
newLimit
- as an integer representing the maximum number of enemy deaths
-
getEnemyCount
public int getEnemyCount()Returns the number of enemy left- Returns:
- (int) enemy count
-
updateEnemyCount
public void updateEnemyCount()Updates enemy count If enemy count is 0, the game is over. -
setLevelCompleted
public void setLevelCompleted()Set the level to be completed. Will be called when there are no waves remaining. -
setNextLane
public void setNextLane(int lane) Sets the waveCount- Parameters:
lane
- as an integer representing the next lane of a mob.
-
getNextLane
public int getNextLane()Returns the next lane number of a mob- Returns:
- (int) lane number
-
isLevelCompleted
public boolean isLevelCompleted()Returns the game over state- Returns:
- (boolean) true if the game is over; false otherwise
-
getWaveCount
public int getWaveCount()Returns the game over state- Returns:
- (boolean) true if the game is over; false otherwise
-
setWaveCount
public void setWaveCount(int waveCount) Sets the waveCount- Parameters:
waveCount
- as an integer representing the current wave number. This will be added to the current wave number.
-
getNextWaveTime
public long getNextWaveTime()Returns time of the next wave.- Returns:
- (long) A timestamp of when the next mobs will spawn. Used for UI elements.
-
setNextWaveTime
public void setNextWaveTime(long nextWaveTime) Sets the next wave timestamp- Parameters:
nextWaveTime
- as a long which is the time when then next mobs will spawn.
-
setSpawnDelay
public void setSpawnDelay(int spawnDelay) Sets the spawn delay between levels- Parameters:
spawnDelay
- representing the spawnDelay between levels.
-
getSpawnDelay
public int getSpawnDelay()Returns the spawn delay between levels- Returns:
- (int) The spawn delay between levels.
-
getDisplay
-