Class AudioPlayValidator

java.lang.Object
com.csse3200.game.cutscene.validators.actionvalidators.AudioPlayValidator
All Implemented Interfaces:
ActionValidator

public class AudioPlayValidator extends Object implements ActionValidator
Implements the ActionValidator interface for concrete implementation of the validate method.

Validates audio play events against the following conditions:

  • bus is a valid string
  • bus is either "sfx" or "music"
  • If bus is "sfx" it must have the following flags with conditions:
    • volume: [0.0, 1.0]
    • pitch: [0.0, +inf]
    • pan: [-1.0, 1.0]
  • If bus is "music" it must have the following flags with conditions:
    • loop: (boolean)
    • volume: [0.0, 1.0]
  • soundId is a valid string and references a valid sound
  • await is valid using ValidatorUtils.validateAwait(String, ActionDTO)
  • Constructor Details

    • AudioPlayValidator

      public AudioPlayValidator()
  • Method Details