예제 #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);
        }
예제 #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);
        }
예제 #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);
            }
        }
예제 #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);
     }
 }
예제 #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));
 }
예제 #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));
 }