public float SumPercentageFactorAndValue(float value) { if (Unit != EntityStatUnit.Percentage) { throw new Exception("Unit != EntityStatUnit.Percentage " + this); } //float val = GetValueToCalcPercentage(useCurrentValue); return(FactorCalculator.AddFactor(value, this.Factor)); }
public float SumValueAndPercentageFactor(float factorPercentage, bool useCurrentValue) { if (Unit != EntityStatUnit.Absolute) { throw new Exception("Unit != EntityStatUnit.Absolute " + this); } float val = GetValueToCalcPercentage(useCurrentValue); return(FactorCalculator.AddFactor(val, factorPercentage)); }