Class PeriodicAmbientSoundSource

All Implemented Interfaces:
TurnListener, Killer, Cloneable, Iterable<String>, Serializable

public class PeriodicAmbientSoundSource extends PassiveEntity implements TurnListener
Periodicially plays an ambient sound.
Author:
hendrik
  • Constructor Details

    • PeriodicAmbientSoundSource

      public PeriodicAmbientSoundSource(String sound, int radius, int volume, int minInterval, int maxInterval)
      Create an ambient sound area.
      Parameters:
      sound - name of sound (or sounds) to play
      radius - hearing radius
      volume - volume
      minInterval - minimum time between two sounds in seconds
      maxInterval - maximum time between two sounds in seconds
  • Method Details

    • onTurnReached

      public void onTurnReached(int currentTurn)
      randomly picks a sound, sends a SoundEvent to the client and sets the notifier up for the next sound.
      Specified by:
      onTurnReached in interface TurnListener
      Parameters:
      currentTurn - current turn number