public Damage GetDamage(HumanoidImpactTarget target) { int index = (int)target; if (index >= 0 && index < _damageArray.Length) { return(_damageArray[index]); } throw new ArgumentOutOfRangeException(nameof(target), $"{index} is not in range {0}..{_damageArray.Length}"); }
public void DoDamage(Damage damage, HumanoidImpactTarget target) { int index = (int)target; if (index >= 0 && index < _damageArray.Length) { _damageArray[index] += damage; } else { throw new ArgumentOutOfRangeException(nameof(target), $"{index} is not in range {0}..{_damageArray.Length}"); } }