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

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

Validates choice events against the following conditions:

  • prompt must be a string
  • choices must be a list
  • Each element of choices must be a map
  • Each entry in each choice map must have a String key and String value
  • No key or value can be empty or null
  • The choice field entryBeatId must be a valid beat id (only checked for "current" cutsceneId)
  • Each choice map must contain the following keys:
    • type
    • line
    • cutsceneId
    • entryBeatId
  • Constructor Details

    • ChoiceValidator

      public ChoiceValidator()
  • Method Details