DialogueLevel constructor

DialogueLevel({
  1. required Game game,
  2. required List<Message> messages,
  3. required void onDone(),
  4. ScanCode? progressScanCode,
  5. GameControllerButton? progressControllerButton,
  6. int position = 0,
  7. SoundChannel? soundChannel,
  8. AssetReference? music,
  9. List<Ambiance>? ambiances,
  10. List<RandomSound>? randomSounds,
  11. Map<String, Command>? commands,
})

Create an instance.

Implementation

DialogueLevel({
  required super.game,
  required this.messages,
  required this.onDone,
  this.progressScanCode,
  this.progressControllerButton,
  this.position = 0,
  this.soundChannel,
  super.music,
  super.ambiances,
  super.randomSounds,
  super.commands,
})  : assert(
        progressScanCode != null || progressControllerButton != null,
        'Both `ProgressControllerButton` and `progressScanCode` cannot be '
        '`null`.',
      ),
      assert(
        messages.where((final element) => element.keepAlive == false).isEmpty,
        'All messages must have their `keepAlive` value set to `true`.',
      );