Exemplo n.º 1
0
        void AddThresholdsFrom(IOnDamageBehavior onDamageBehavior)
        {
            if (onDamageBehavior == null)
            {
                throw new ArgumentNullException(nameof(onDamageBehavior));
            }

            List <DamageThreshold> thresholds = onDamageBehavior.GetAllDamageThresholds();

            foreach (DamageThreshold threshold in thresholds)
            {
                if (!Thresholds[threshold.DamageType].Contains(threshold.Value))
                {
                    Thresholds[threshold.DamageType].Add(threshold.Value);
                }
            }
        }
        void AddThresholdsFrom(IOnDamageBehavior onDamageBehavior)
        {
            if (onDamageBehavior == null)
            {
                throw new ArgumentNullException(nameof(onDamageBehavior));
            }

            List <DamageThreshold> thresholds = onDamageBehavior.GetAllDamageThresholds();

            if (thresholds == null)
            {
                return;
            }

            foreach (DamageThreshold threshold in thresholds)
            {
                if (!Thresholds[threshold.DamageType].Contains(threshold))
                {
                    Thresholds[threshold.DamageType].Add(threshold);
                }
            }

            DamageThresholdPassed += onDamageBehavior.OnDamageThresholdPassed;
        }