Beispiel #1
0
        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}");
        }
Beispiel #2
0
        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}");
            }
        }