Пример #1
0
        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);
            }
        }
Пример #2
0
        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);
            }
        }
Пример #3
0
        public double?Evaluate(ICalculationVariables variables)
        {
            var value = argument.Evaluate(variables);

            return(value == null ? (double?)null : Math.Ceiling(value.Value));
        }
Пример #4
0
 public double?Evaluate(ICalculationVariables variables)
 {
     return(value);
 }