private static string GetValue( ValueExpression valueExpression, IReadOnlyDictionary <string, IVariableValueResolver> variables) { if (valueExpression is ConstantExpression constant) { return(constant.Value); } if (valueExpression is VariableExpression variable) { return(VariableResolver.ResolveValue(variable, variables)); } throw new Exception($"Value type {valueExpression.GetType().Name} not supported"); }
private static string ResolveStringPart(object obj, EsiExecutionContext executionContext) { if (obj == null) { throw new ArgumentNullException(nameof(obj)); } switch (obj) { case string s: return(s); case VariableExpression v: return(VariableResolver.ResolveValue(v, executionContext.Variables)); default: throw new Exception($"Unknown part type '{obj.GetType().Name}'."); } }