public double?Evaluate(ICalculationVariables variables) { switch (name) { case "Input": return(variables.Input); case "AnnouncedDepth": return(variables.AnnouncedDepth); case "AnnouncedDistance": return(variables.AnnouncedDistance); case "AnnouncedDuration": return(variables.AnnouncedDuration); case "RealizedDepth": return(variables.RealizedDepth); case "RealizedDistance": return(variables.RealizedDistance); case "RealizedDuration": return(variables.RealizedDuration); default: return(null); } }
public double?Evaluate(ICalculationVariables variables) { var valueA = a.Evaluate(variables); var valueB = b.Evaluate(variables); if (valueA == null || valueB == null) { return(null); } switch (operation) { case '+': return(valueA.Value + valueB.Value); case '-': return(valueA.Value - valueB.Value); case '*': return(valueA.Value * valueB.Value); case '/': return(valueA.Value / valueB.Value); default: return(valueA); } }
public double?Evaluate(ICalculationVariables variables) { var value = argument.Evaluate(variables); return(value == null ? (double?)null : Math.Ceiling(value.Value)); }
public double?Evaluate(ICalculationVariables variables) { return(value); }