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); }
public GenerationModifierItem(Sprite _icon, FloatModifier healthGen, FloatModifier manaGen) { HealthGeneration = healthGen; MagicGeneration = manaGen; Icon = _icon; }
public FloatModifier AddModifier(FloatModifier modifier) => new FloatModifier(Bonus + modifier.Bonus, Multiplier.AddModifier(modifier.Multiplier));