using System.Collections.Generic; namespace SPT.SinglePlayer.Models.Healing { public class BodyPartHealth { private readonly Dictionary _effects = new Dictionary(); public float Maximum { get; private set; } public float Current { get; private set; } public IReadOnlyDictionary Effects => _effects; public void Initialize(float current, float maximum) { Maximum = maximum; Current = current; } public void ChangeHealth(float diff) { Current += diff; } public void AddEffect(EBodyPartEffect bodyPartEffect, float time = -1) { _effects[bodyPartEffect] = time; } public void UpdateEffect(EBodyPartEffect bodyPartEffect, float time) { _effects[bodyPartEffect] = time; } public void RemoveAllEffects() { _effects.Clear(); } public void RemoveEffect(EBodyPartEffect bodyPartEffect) { if (_effects.ContainsKey(bodyPartEffect)) { _effects.Remove(bodyPartEffect); } } } }