import 'package:wolf_3d_dart/src/data_types/difficulty.dart';
import 'package:wolf_3d_dart/src/registry/keys/menu_pic_key.dart';

/// The resolved reference for a menu picture: a zero-based index into
/// [WolfensteinData.vgaImages].
class MenuPicRef {
  const MenuPicRef(this.pictureIndex);

  final int pictureIndex;

  @override
  String toString() => 'MenuPicRef($pictureIndex)';
}

/// Owns the mapping from symbolic [MenuPicKey] values to VGA picture indices.
///
/// Implement this class to provide custom menu art for a modded or alternate
/// game version. Pass the implementation inside a custom [AssetRegistry] when
/// loading data.
abstract class MenuPicModule {
  const MenuPicModule();

  /// Resolves [key] to a [MenuPicRef] containing the VGA picture index.
  ///
  /// Returns `null` if the key is not supported by this module.
  MenuPicRef? resolve(MenuPicKey key);

  /// Returns the [MenuPicKey] for the episode selection picture at
  /// zero-based [episodeIndex].
  MenuPicKey episodeKey(int episodeIndex);

  /// Returns the [MenuPicKey] for the given [difficulty] selection screen.
  MenuPicKey difficultyKey(Difficulty difficulty);
}
