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); }
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); }
public void SetOnActivate() { switch (Type) { case (ItemType.Points): onActivate = Scripts.findPoints; break; case (ItemType.Thief): onActivate = Scripts.findThief; break; case (ItemType.Bomb): onActivate = Scripts.findBomb; break; case (ItemType.Map): onActivate = Scripts.findMap; break; } }
/// <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)); }
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)); }