示例#1
0
        public static FloatModifier SumModifiers <T>(this IEnumerable <T> enumerable, Func <T, FloatModifier> getter) where T : IModifier
        {
            var result = new FloatModifier(0, 0, 0);

            foreach (var item in enumerable)
            {
                var modifier = getter(item);
                result = result.AddModifier(modifier);
            }
            return(result);
        }
示例#2
0
 public GenerationModifierItem(Sprite _icon, FloatModifier healthGen, FloatModifier manaGen)
 {
     HealthGeneration = healthGen;
     MagicGeneration  = manaGen;
     Icon             = _icon;
 }
示例#3
0
 public FloatModifier AddModifier(FloatModifier modifier) => new FloatModifier(Bonus + modifier.Bonus, Multiplier.AddModifier(modifier.Multiplier));