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
-
Method Summary
Modifier and TypeMethodDescriptionint
Gets the current wave indexint
Gets the priority of the current taskString[]
Get the sounds to be played when a wave starts or endsboolean
Checks if the current wave is in progressvoid
Load the sounds to be played when a wave starts or endsvoid
start()
Starts the WaveTask and initialises all relevant attributes.void
update()
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:
getPriority
in 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:
start
in interfaceTask
- Overrides:
start
in 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:
update
in interfaceTask
- Overrides:
update
in 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
-