import '../enums.dart';

class StatusEffect {
  final StatusEffectType type;
  int duration; // Turns remaining
  final int value; // Intensity (e.g., bleed damage amount)

  StatusEffect({required this.type, required this.duration, this.value = 0});

  Map<String, dynamic> toJson() {
    return {
      'type': type.name,
      'duration': duration,
      'value': value,
    };
  }

  factory StatusEffect.fromJson(Map<String, dynamic> json) {
    return StatusEffect(
      type: StatusEffectType.values.firstWhere((e) => e.name == json['type']),
      duration: json['duration'],
      value: json['value'],
    );
  }
}
