Example #1
0
 public ForEachScript(WorldModel worldModel, string variable, IFunctionGeneric list, IScript loopScript)
 {
     m_worldModel = worldModel;
     m_variable = variable;
     m_list = list;
     m_loopScript = loopScript;
 }
Example #2
0
 public ForEachScript(ScriptContext scriptContext, string variable, IFunctionGeneric list, IScript loopScript)
 {
     m_scriptContext = scriptContext;
     m_variable = variable;
     m_list = list;
     m_loopScript = loopScript;
 }
Example #3
0
 public ListAddScript(ScriptContext scriptContext, IFunctionGeneric list, IFunction<object> value)
 {
     m_scriptContext = scriptContext;
     m_list = list;
     m_value = value;
     m_worldModel = scriptContext.WorldModel;
 }
Example #4
0
 public DictionaryAddScript(WorldModel worldModel, IFunctionGeneric dictionary, IFunction<string> key, IFunction<object> value)
 {
     m_dictionary = dictionary;
     m_key = key;
     m_value = value;
     m_worldModel = worldModel;
 }
Example #5
0
 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;
 }
Example #6
0
 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;
 }
Example #7
0
 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();
     }
 }
Example #8
0
 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();
     }
 }
Example #9
0
 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();
     }
 }
Example #10
0
 public MsgScript(WorldModel worldModel, IFunctionGeneric function)
 {
     m_worldModel = worldModel;
     m_function = function;
 }
Example #11
0
 public SwitchScript(ScriptContext scriptContext, IFunctionGeneric expression, Dictionary<IFunctionGeneric, IScript> cases, IScript defaultScript)
     : this(scriptContext, expression, defaultScript)
 {
     m_cases = new SwitchCases(this, cases);
 }
Example #12
0
 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();
     }
 }
Example #13
0
 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);
 }
Example #14
0
 public ListAddScript(WorldModel worldModel, IFunctionGeneric list, IFunction<object> value)
 {
     m_list = list;
     m_value = value;
     m_worldModel = worldModel;
 }
Example #15
0
 public ErrorScript(WorldModel worldModel, IFunctionGeneric function)
 {
     m_function = function;
     m_worldModel = worldModel;
 }
Example #16
0
 public ReturnScript(WorldModel worldModel, IFunctionGeneric returnValue)
 {
     m_worldModel = worldModel;
     m_returnValue = returnValue;
 }
Example #17
0
 public DictionaryRemoveScript(WorldModel worldModel, IFunctionGeneric dictionary, IFunction<string> key)
 {
     m_dictionary = dictionary;
     m_key = key;
     m_worldModel = worldModel;
 }
Example #18
0
 private SwitchScript(WorldModel worldModel, IFunctionGeneric expression, IScript defaultScript)
 {
     m_worldModel = worldModel;
     m_expr = expression;
     m_default = defaultScript ?? new MultiScript();
 }
Example #19
0
 public SwitchScript(WorldModel worldModel, IFunctionGeneric expression, Dictionary<IFunctionGeneric, IScript> cases, IScript defaultScript)
     : this(worldModel, expression, defaultScript)
 {
     m_cases = new SwitchCases(this, cases);
 }
Example #20
0
 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();
     }
 }
Example #21
0
 public override void SetParameterInternal(int index, object value)
 {
     m_function = new ExpressionGeneric((string)value, m_worldModel);
 }
Example #22
0
 public ReturnScript(ScriptContext scriptContext, IFunctionGeneric returnValue)
 {
     m_scriptContext = scriptContext;
     m_worldModel = scriptContext.WorldModel;
     m_returnValue = returnValue;
 }
Example #23
0
 public MsgScript(ScriptContext scriptContext, IFunctionGeneric function)
 {
     m_scriptContext = scriptContext;
     m_worldModel = scriptContext.WorldModel;
     m_function = function;
 }
Example #24
0
 public override void SetParameterInternal(int index, object value)
 {
     m_returnValue = new ExpressionGeneric((string)value, m_scriptContext);
 }
Example #25
0
 public DictionaryRemoveScript(ScriptContext scriptContext, IFunctionGeneric dictionary, IFunction<string> key)
 {
     m_scriptContext = scriptContext;
     m_dictionary = dictionary;
     m_key = key;
     m_worldModel = scriptContext.WorldModel;
 }