import 'package:wolf_3d_dart/src/data_types/game_version.dart';

/// Canonical sound-effect identifiers used by built-in registries.
enum SoundEffect {
  // --- Doors & Environment ---
  openDoor(retailId: 8),
  closeDoor(retailId: 9),
  pushWall(retailId: 46),

  // --- Weapons ---
  knifeAttack(retailId: 23),
  pistolFire(retailId: 24),
  machineGunFire(retailId: 26),
  chainGunFire(retailId: 32),
  enemyFire(retailId: 58),

  // --- Pickups ---
  getMachineGun(retailId: 30),
  getAmmo(retailId: 31),
  getChainGun(retailId: 38),
  healthSmall(retailId: 33),
  healthLarge(retailId: 34),
  treasure1(retailId: 35),
  treasure2(retailId: 36),
  treasure3(retailId: 37),
  treasure4(retailId: 45),
  extraLife(retailId: 44),

  // --- Standard Enemies ---
  guardHalt(retailId: 21),
  dogBark(retailId: 41),
  dogDeath(retailId: 62),
  dogAttack(retailId: 68),
  deathScream1(retailId: 29),
  deathScream2(retailId: 22),
  deathScream3(retailId: 25),
  ssAlert(retailId: 51),
  ssDeath(retailId: 63),

  // --- Bosses ---
  bossActive(retailId: 49),
  hansGrosseDeath(retailId: 50),
  schabbs(retailId: 64),
  schabbsDeath(retailId: 54),
  hitlerGreeting(retailId: 55),
  hitlerDeath(retailId: 57),
  mechaSteps(retailId: 70),
  ottoAlert(retailId: 66),
  gretelDeath(retailId: 67),

  // --- UI & Progression ---
  levelComplete(retailId: 40),
  endBonus1(retailId: 42),
  endBonus2(retailId: 43),
  noBonus(retailId: 47),
  percent100(retailId: 48),
  ;

  const SoundEffect({required this.retailId, int? sharewareId})
    : sharewareId = sharewareId ?? retailId;

  final int retailId;
  final int sharewareId;

  int idFor(GameVersion version) {
    switch (version) {
      case GameVersion.shareware:
        return sharewareId;
      case GameVersion.retail:
      case GameVersion.spearOfDestiny:
      case GameVersion.spearOfDestinyDemo:
        return retailId;
    }
  }
}
