public static StatsModifierObject operator *(double smo1, StatsModifierObject smo2) { if (smo2 == null) { throw new ArgumentNullException(nameof(smo2)); } StatsModifierObject smo = new StatsModifierObject(); smo.Value = smo1 * smo2.Value; smo.Percent = smo2.Percent; return smo; }
public static StatsModifierObject operator *(StatsModifierObject smo1, StatsModifierObject smo2) { if (smo1 == null) { throw new ArgumentNullException(nameof(smo1)); } if (smo2 == null) { throw new ArgumentNullException(nameof(smo2)); } StatsModifierObject smo = new StatsModifierObject(); smo.Value = smo1.Value * smo2.Value; smo.Percent = ((100d + smo1.Percent) / 100d * (100d + smo2.Percent) / 100d) * 100d - 100d; return smo; }
public static StatsModifierObject operator /(StatsModifierObject smo1, double smo2) { if (smo1 == null) { throw new ArgumentNullException(nameof(smo1)); } StatsModifierObject smo = new StatsModifierObject(); smo.Value = smo1.Value / smo2; smo.Percent = smo1.Percent; return smo; }