import 'package:wolf_3d_dart/src/data_types/enemy_animation.dart';
import 'package:wolf_3d_dart/src/registry/keys/entity_key.dart';

/// All version-sensitive asset data for a single entity type.
///
/// - [animations] is `null` for bosses that drive sprite selection with
///   custom logic and do not use the standard [EnemyAnimationMap].
/// - [baseSpriteIndex] is the sprite-list offset used by custom-logic bosses
///   as the base for their manual frame calculations.
/// - [availableInShareware] mirrors the original engine's version-exclusion
///   flag; entities with `false` are skipped during shareware level loading.
class EntityAssetDefinition {
  const EntityAssetDefinition({
    this.animations,
    this.baseSpriteIndex,
    this.availableInShareware = true,
  });

  final EnemyAnimationMap? animations;
  final int? baseSpriteIndex;
  final bool availableInShareware;
}

/// Owns the mapping from symbolic [EntityKey] values to version-specific
/// [EntityAssetDefinition] objects.
///
/// Implement this class to provide custom sprite data for a modded or
/// alternate game version. Pass the implementation inside a custom
/// [AssetRegistry] when loading data.
abstract class EntityAssetModule {
  const EntityAssetModule();

  /// Resolves [key] to an [EntityAssetDefinition].
  ///
  /// Returns `null` if the key is not recognised by this module.
  EntityAssetDefinition? resolve(EntityKey key);
}
