java.lang.Object
com.csse3200.game.ai.tasks.DefaultTask
com.csse3200.game.components.tasks.waves.WaveTask
All Implemented Interfaces:
PriorityTask, Task

public class WaveTask extends DefaultTask implements PriorityTask
  • 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

      public String[] 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 interface PriorityTask
      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 interface Task
      Overrides:
      start in class DefaultTask
    • 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 interface Task
      Overrides:
      update in class DefaultTask
    • 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