import 'package:wolf_3d_dart/src/registry/keys/sfx_key.dart';

/// The resolved reference for a sound effect: a numeric slot index into
/// [WolfensteinData.sounds].
class SoundAssetRef {
  const SoundAssetRef(this.slotIndex);

  final int slotIndex;

  @override
  String toString() => 'SoundAssetRef($slotIndex)';
}

/// Owns the mapping from symbolic [SoundEffect] identifiers to numeric sound slots.
///
/// Implement this class to provide a custom sound layout for a modded or
/// alternate game version. Pass the implementation inside a custom
/// [AssetRegistry] when loading data.
abstract class SfxModule {
  const SfxModule();

  /// Resolves [key] to a [SoundAssetRef] containing the numeric slot index.
  ///
  /// Returns `null` if the key is not supported by this module.
  SoundAssetRef? resolve(SoundEffect key);
}
