Ejemplo n.º 1
0
        public static ScriptWrapper CreateScriptWrapperWithArgs <T, U, V, W> (ScriptWithArgs <T, U, V, W> script, T arg1, U arg2, V arg3, W arg4, params string[] tags)
        {
            ScriptWrapper newWrapper = new ScriptWrapper();

            newWrapper.thisScript = script(arg1, arg2, arg3, arg4);
            InitializeWrapper(newWrapper, tags);

            return(newWrapper);
        }
Ejemplo n.º 2
0
        public static ScriptWrapper CreateScriptWrapperWithArgs <T> (ScriptWithArgs <T> script, T arg, params string[] tags)
        {
            ScriptWrapper newWrapper = new ScriptWrapper();

            newWrapper.thisScript = script(arg);
            InitializeWrapper(newWrapper, tags);

            return(newWrapper);
        }
Ejemplo n.º 3
0
        private static void InitializeWrapper(ScriptWrapper newWrapper, params string[] tags)
        {
            newWrapper.State = ScriptState.Running;

            // Build the list of tags
            newWrapper.Tags = new List <string> ();
            foreach (string s in tags)
            {
                newWrapper.Tags.Add(s);
            }
        }
Ejemplo n.º 4
0
 public void PauseScript(ScriptWrapper script, ScriptPauser suspender)
 {
     if (suspender.Type == PauseScriptType.Seconds)
     {
         script.SetState(ScriptState.WaitingForTime);
         WaitingForTime.Add(script, (float)(currentTime + suspender.SleepTime));
     }
     else if (suspender.Type == PauseScriptType.Signal)
     {
         WaitingForSignal.Add(script, suspender.AwakenSignal);
         script.SetState(ScriptState.WaitingForSignal);
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Execute a script with arguments.
 /// </summary>
 /// <param name='script'>
 /// The script to execute.
 /// </param>
 /// <param name='tags'>
 /// An optional array of tags to apply to the script.
 /// </param>
 public void ExecuteWithArgs <T, U>(ScriptWithArgs <T, U> script, T arg1, U arg2, params string[] tags)
 {
     Scripts.Add(ScriptWrapper.CreateScriptWrapperWithArgs(script, arg1, arg2, tags));
 }
Ejemplo n.º 6
0
 public void ExecuteWithArgs <T, U, V, W, X, Y, Z>(ScriptWithArgs <T, U, V, W, X, Y, Z> script,
                                                   T arg1, U arg2, V arg3, W arg4, X arg5, Y arg6, Z arg7, params string[] tags)
 {
     Scripts.Add(ScriptWrapper.CreateScriptWrapperWithArgs(script, arg1, arg2, arg3, arg4, arg5, arg6, arg7, tags));
 }