Class WaveTask
java.lang.Object
com.csse3200.game.ai.tasks.DefaultTask
com.csse3200.game.components.tasks.waves.WaveTask
- All Implemented Interfaces:
PriorityTask,Task
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.csse3200.game.ai.tasks.Task
Task.Status -
Field Summary
Fields inherited from class com.csse3200.game.ai.tasks.DefaultTask
owner, status -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintGets the current wave indexintGets the priority of the current taskString[]Get the sounds to be played when a wave starts or endsbooleanChecks if the current wave is in progressvoidLoad the sounds to be played when a wave starts or endsvoidstart()Starts the WaveTask and initialises all relevant attributes.voidupdate()Checks if the current wave has finished (i.e.Methods inherited from class com.csse3200.game.ai.tasks.DefaultTask
create, getStatus, stop
-
Constructor Details
-
WaveTask
public WaveTask()Constructor for the WaveTask
-
-
Method Details
-
loadSounds
public void loadSounds()Load the sounds to be played when a wave starts or ends -
getSounds
Get the sounds to be played when a wave starts or ends- Returns:
- String array of sounds
-
getPriority
public int getPriority()Gets the priority of the current task- Specified by:
getPriorityin interfacePriorityTask- Returns:
- priority of the WaveTask
-
start
public void start()Starts the WaveTask and initialises all relevant attributes. Sets the current count of enemies to be the size of the current wave.- Specified by:
startin interfaceTask- Overrides:
startin classDefaultTask
-
update
public void update()Checks if the current wave has finished (i.e. number of mobs left is 0) and calls the next wave to begin. If there are still mobs remaining, continue the wave.- Specified by:
updatein interfaceTask- Overrides:
updatein classDefaultTask
-
isWaveInProgress
public boolean isWaveInProgress()Checks if the current wave is in progress- Returns:
- true if the wave is in progress, false otherwise
-
getCurrentWaveIndex
public int getCurrentWaveIndex()Gets the current wave index- Returns:
- current wave index
-