public ForEachScript(WorldModel worldModel, string variable, IFunctionGeneric list, IScript loopScript) { m_worldModel = worldModel; m_variable = variable; m_list = list; m_loopScript = loopScript; }
public ForEachScript(ScriptContext scriptContext, string variable, IFunctionGeneric list, IScript loopScript) { m_scriptContext = scriptContext; m_variable = variable; m_list = list; m_loopScript = loopScript; }
public DictionaryRemoveScript(ScriptContext scriptContext, IFunctionGeneric dictionary, IFunction <string> key) { m_scriptContext = scriptContext; m_dictionary = dictionary; m_key = key; m_worldModel = scriptContext.WorldModel; }
public ListAddScript(ScriptContext scriptContext, IFunctionGeneric list, IFunction<object> value) { m_scriptContext = scriptContext; m_list = list; m_value = value; m_worldModel = scriptContext.WorldModel; }
public DictionaryAddScript(WorldModel worldModel, IFunctionGeneric dictionary, IFunction<string> key, IFunction<object> value) { m_dictionary = dictionary; m_key = key; m_value = value; m_worldModel = worldModel; }
public ListAddScript(ScriptContext scriptContext, IFunctionGeneric list, IFunction <object> value) { m_scriptContext = scriptContext; m_list = list; m_value = value; m_worldModel = scriptContext.WorldModel; }
private SwitchScript(ScriptContext scriptContext, IFunctionGeneric expression, IScript defaultScript) { m_scriptContext = scriptContext; m_worldModel = scriptContext.WorldModel; m_expr = expression; m_default = defaultScript ?? new MultiScript(m_worldModel); }
public DictionaryAddScript(ScriptContext scriptContext, IFunctionGeneric dictionary, IFunction<string> key, IFunction<object> value) { m_scriptContext = scriptContext; m_dictionary = dictionary; m_key = key; m_value = value; m_worldModel = scriptContext.WorldModel; }
public DictionaryAddScript(ScriptContext scriptContext, IFunctionGeneric dictionary, IFunction <string> key, IFunction <object> value) { m_scriptContext = scriptContext; m_dictionary = dictionary; m_key = key; m_value = value; m_worldModel = scriptContext.WorldModel; }
public ShowMenuScript(ScriptContext scriptContext, IScriptFactory scriptFactory, IFunction <string> caption, IFunctionGeneric options, IFunction <bool> allowCancel, IScript callbackScript) { m_scriptContext = scriptContext; m_worldModel = scriptContext.WorldModel; m_scriptFactory = scriptFactory; m_caption = caption; m_options = options; m_allowCancel = allowCancel; m_callbackScript = callbackScript; }
public ShowMenuScript(ScriptContext scriptContext, IScriptFactory scriptFactory, IFunction<string> caption, IFunctionGeneric options, IFunction<bool> allowCancel, IScript callbackScript) { m_scriptContext = scriptContext; m_worldModel = scriptContext.WorldModel; m_scriptFactory = scriptFactory; m_caption = caption; m_options = options; m_allowCancel = allowCancel; m_callbackScript = callbackScript; }
public override void SetParameterInternal(int index, object value) { switch (index) { case 0: m_list = new ExpressionGeneric((string)value, m_worldModel); break; case 1: m_value = new Expression<object>((string)value, m_worldModel); break; default: throw new ArgumentOutOfRangeException(); } }
public bool Execute(Context c, string result) { foreach (var switchCase in m_cases) { IFunctionGeneric expr = m_compiledExpressions[switchCase.Key]; if (result == expr.Execute(c).ToString()) { switchCase.Value.Execute(c); return(true); } } return(false); }
public override void SetParameterInternal(int index, object value) { switch (index) { case 0: m_list = new ExpressionGeneric((string)value, m_scriptContext); break; case 1: m_value = new Expression <object>((string)value, m_scriptContext); break; default: throw new ArgumentOutOfRangeException(); } }
public SwitchCases(SwitchScript parent, Dictionary <IFunctionGeneric, IScript> cases) : this(parent) { foreach (var switchCase in cases) { IFunctionGeneric compiledExpression = switchCase.Key; string caseString = compiledExpression.Save(); IScript script = switchCase.Value; if (m_cases.ContainsKey(caseString)) { throw new Exception(string.Format("'switch' block contains duplicate case '{0}'", caseString)); } m_cases.Add(caseString, script); m_compiledExpressions.Add(caseString, compiledExpression); } }
public override void SetParameterInternal(int index, object value) { switch (index) { case 0: m_variable = (string)value; break; case 1: m_list = new ExpressionGeneric((string)value, m_scriptContext); break; case 2: throw new InvalidOperationException("Attempt to use SetParameter to change the script of a 'foreach' loop"); default: throw new ArgumentOutOfRangeException(); } }
public override void SetParameterInternal(int index, object value) { switch (index) { case 0: m_expr = new ExpressionGeneric((string)value, m_scriptContext); break; case 1: // any updates to the cases should change the scriptdictionary itself - nothing should cause SetParameter to be triggered. throw new InvalidOperationException("Attempt to use SetParameter to change the cases of a 'switch'"); case 2: // any updates to the script should change the script itself - nothing should cause SetParameter to be triggered. throw new InvalidOperationException("Attempt to use SetParameter to change the script of a 'switch'"); default: throw new ArgumentOutOfRangeException(); } }
public override void SetParameterInternal(int index, object value) { switch (index) { case 0: m_caption = new Expression <string>((string)value, m_scriptContext); break; case 1: m_options = new ExpressionGeneric((string)value, m_scriptContext); break; case 2: m_allowCancel = new Expression <bool>((string)value, m_scriptContext); break; case 3: // any updates to the script should change the script itself - nothing should cause SetParameter to be triggered. throw new InvalidOperationException("Attempt to use SetParameter to change the script of a 'show menu' command"); default: throw new ArgumentOutOfRangeException(); } }
public SwitchScript(ScriptContext scriptContext, IFunctionGeneric expression, Dictionary<IFunctionGeneric, IScript> cases, IScript defaultScript) : this(scriptContext, expression, defaultScript) { m_cases = new SwitchCases(this, cases); }
public SwitchScript(ScriptContext scriptContext, IFunctionGeneric expression, Dictionary <IFunctionGeneric, IScript> cases, IScript defaultScript) : this(scriptContext, expression, defaultScript) { m_cases = new SwitchCases(this, cases); }
public override void SetParameterInternal(int index, object value) { switch (index) { case 0: m_dictionary = new ExpressionGeneric((string)value, m_scriptContext); break; case 1: m_key = new Expression<string>((string)value, m_scriptContext); break; case 2: m_value = new Expression<object>((string)value, m_scriptContext); break; default: throw new ArgumentOutOfRangeException(); } }
public MsgScript(WorldModel worldModel, IFunctionGeneric function) { m_worldModel = worldModel; m_function = function; }
public ErrorScript(ScriptContext scriptContext, IFunctionGeneric function) { m_scriptContext = scriptContext; m_function = function; m_worldModel = scriptContext.WorldModel; }
public ReturnScript(WorldModel worldModel, IFunctionGeneric returnValue) { m_worldModel = worldModel; m_returnValue = returnValue; }
public ListAddScript(WorldModel worldModel, IFunctionGeneric list, IFunction<object> value) { m_list = list; m_value = value; m_worldModel = worldModel; }
public ReturnScript(ScriptContext scriptContext, IFunctionGeneric returnValue) { m_scriptContext = scriptContext; m_worldModel = scriptContext.WorldModel; m_returnValue = returnValue; }
public SwitchScript(WorldModel worldModel, IFunctionGeneric expression, Dictionary<IFunctionGeneric, IScript> cases, IScript defaultScript) : this(worldModel, expression, defaultScript) { m_cases = new SwitchCases(this, cases); }
public MsgScript(ScriptContext scriptContext, IFunctionGeneric function) { m_scriptContext = scriptContext; m_worldModel = scriptContext.WorldModel; m_function = function; }
public override void SetParameterInternal(int index, object value) { switch (index) { case 0: m_variable = (string)value; break; case 1: m_list = new ExpressionGeneric((string)value, m_worldModel); break; case 2: throw new InvalidOperationException("Attempt to use SetParameter to change the script of a 'foreach' loop"); default: throw new ArgumentOutOfRangeException(); } }
public override void SetParameterInternal(int index, object value) { switch (index) { case 0: m_caption = new Expression<string>((string)value, m_scriptContext); break; case 1: m_options = new ExpressionGeneric((string)value, m_scriptContext); break; case 2: m_allowCancel = new Expression<bool>((string)value, m_scriptContext); break; case 3: // any updates to the script should change the script itself - nothing should cause SetParameter to be triggered. throw new InvalidOperationException("Attempt to use SetParameter to change the script of a 'show menu' command"); default: throw new ArgumentOutOfRangeException(); } }
public override void SetParameterInternal(int index, object value) { m_returnValue = new ExpressionGeneric((string)value, m_scriptContext); }
public DictionaryRemoveScript(WorldModel worldModel, IFunctionGeneric dictionary, IFunction<string> key) { m_dictionary = dictionary; m_key = key; m_worldModel = worldModel; }
public ErrorScript(WorldModel worldModel, IFunctionGeneric function) { m_function = function; m_worldModel = worldModel; }
public RequestSpeakScript(ScriptContext scriptContext, IFunctionGeneric function) { m_scriptContext = scriptContext; m_worldModel = scriptContext.WorldModel; m_function = function; }
public override void SetParameterInternal(int index, object value) { m_function = new ExpressionGeneric((string)value, m_worldModel); }
private SwitchScript(WorldModel worldModel, IFunctionGeneric expression, IScript defaultScript) { m_worldModel = worldModel; m_expr = expression; m_default = defaultScript ?? new MultiScript(); }
public DictionaryRemoveScript(ScriptContext scriptContext, IFunctionGeneric dictionary, IFunction<string> key) { m_scriptContext = scriptContext; m_dictionary = dictionary; m_key = key; m_worldModel = scriptContext.WorldModel; }