import 'package:wolf_3d_dart/wolf_3d_data_types.dart';

/// A complete, immutable container for all assets belonging to a specific
/// version of Wolfenstein 3D.
///
/// This object holds the extracted textures, sounds, music, and levels,
/// serving as the primary data source for the game engine's renderer
/// and audio system.
///
/// The [registry] field provides version-aware symbolic resolution of all
/// asset IDs (sprites, sounds, music, HUD, menus). Consumers should prefer
/// registry lookups over hard-coded numeric indices.
class WolfensteinData {
  /// The version of the game these assets belong to (e.g., Shareware or Retail).
  final GameVersion version;

  /// The exact data-file identity determined from the VSWAP MD5 checksum.
  ///
  /// Use this when you need to distinguish, for example, v1.0 from v1.4 retail.
  final DataVersion dataVersion;

  /// The modular asset registry that owns all version-sensitive numeric IDs.
  ///
  /// Access the five sub-modules via:
  /// ```dart
  /// data.registry.sfx.resolve(SoundEffect.pistolFire)
  /// data.registry.music.musicForLevel(episode, level)
  /// data.registry.entities.resolve(EntityKey.guard)
  /// data.registry.hud.faceForHealth(player.health)
  /// data.registry.menu.resolve(MenuPicKey.title)
  /// ```
  final AssetRegistry registry;

  /// The collection of 64x64 wall textures extracted from VSWAP.
  final List<Sprite> walls;

  /// The collection of billboarding sprites (enemies, items, decorations).
  final List<Sprite> sprites;

  /// Digitized 8-bit PCM sound effects.
  final List<PcmSound> sounds;

  /// AdLib (FM Synthesis) sound effects for the OPL2 chip.
  final List<PcmSound> adLibSounds;

  /// The collection of IMF music tracks.
  final List<ImfMusic> music;

  /// UI elements, fonts, and full-screen pictures extracted from VGA assets.
  final List<VgaImage> vgaImages;

  /// The game's levels, organized into episodes (e.g., Episode 1-6).
  final List<Episode> episodes;

  const WolfensteinData({
    required this.version,
    required this.dataVersion,
    required this.registry,
    required this.walls,
    required this.sprites,
    required this.sounds,
    required this.adLibSounds,
    required this.music,
    required this.vgaImages,
    required this.episodes,
  });
}
