예제 #1
0
 public override object Evaluate(IEvaluationContext context = null)
 {
     if (context == null)
     {
         context = DefaultContext;
     }
     return(context.GetVariable(_Description));
     //TODO: Fallback behaviour with no context?
 }
예제 #2
0
        public override float Evaluate(IEvaluationContext context)
        {
            var variable = context.GetVariable(Symbol);

            if (!variable.IsAssigned)
            {
                throw new InvalidOperationException($"Expected variable '{Symbol}' to be set.");
            }
            return(variable.Value.Value);
        }