public void CanCompileEmptyScriptTwice() { var scriptApi = new ScriptApi(); scriptApi.CompileWrappedScript<TestScriptArity4>(""); scriptApi.CompileWrappedScript<TestScriptArity4>(""); }
public void ExtractScriptDocumentation() { var scriptApi = new ScriptApi(); var documentation = scriptApi.ExtractDocumentationFromTypes(new[] { typeof(HappyEnvironment) }); Console.WriteLine(JsonConvert.SerializeObject(documentation, Formatting.Indented)); }
public void CanCompileTypedScript() { var factory = new ScriptApi(); var script = factory.CompileWrappedScript<TestScript>("throw new Exception()"); Assert.Throws<Exception>(script.Run); }
public void Wrapped() { var scriptApi = new ScriptApi(); var wrappedScript = scriptApi.CompileWrappedScript<HappyScript>("Mood(\"Happy!\")"); string result = wrappedScript.Run(); result.ShouldEqual("Happy!"); }
public void HelloWorld() { var scriptApi = new ScriptApi(); var script = scriptApi.CompileScript<HelloWorldEnvironment>("DoIt()"); var environment = new HelloWorldEnvironment(); script.Run(environment); environment.Result.ShouldEqual("Hello World!"); }
public void VerifyScripts() { var scriptApi = new ScriptApi(); scriptApi.VerifyTypes(new [] { typeof(HappyEnvironment) }); }
public static void PushNull(ScriptState luaState) { ScriptApi.PushNull(luaState); }
public static EventMasks GetHookMask(ScriptState luaState) { return((EventMasks)ScriptApi.GetHookMask(luaState)); }
public static void NewUserData(ScriptState luaState, int value) { ScriptApi.NewUserData(luaState, value); }
public static void SetMetatable(ScriptState luaState, int index) { ScriptApi.SetMetatable(luaState, index); }
public static int GetHookCount(ScriptState luaState) { return(ScriptApi.GetHookCount(luaState)); }
public static int ToInt(ScriptState luaState, int index) { return(ScriptApi.ToInt(luaState, ConvertParmenterIndex(index))); }
public static void SetGlobalTable(ScriptState luaState) { ScriptApi.SetGlobalTable(luaState); }
public static void PushInt(ScriptState luaState, int i) { ScriptApi.PushInt(luaState, i); }
public static double ToNumber(ScriptState luaState, int index) { return(ScriptApi.ToNumber(luaState, ConvertParmenterIndex(index))); }
public static void PushString(ScriptState luaState, string str) { ScriptApi.PushString(luaState, str); }
public static void PushBool(ScriptState luaState, bool b) { ScriptApi.PushBool(luaState, b ? 1 : 0); }
public static void PushNumber(ScriptState luaState, double d) { ScriptApi.PushNumber(luaState, d); }
public static void CreateTable(ScriptState luaState) { ScriptApi.CreateTable(luaState); }
public static string ToString(ScriptState luaState, int index) { CharPtr ptrString = ScriptApi.ToString(luaState, ConvertParmenterIndex(index)); return(ptrString.ToString()); }
public static void GetTable(ScriptState luaState, int index) { ScriptApi.GetTable(luaState, index); }
public static bool ToBool(ScriptState luaState, int index) { var result = ScriptApi.ToBool(luaState, ConvertParmenterIndex(index)); return(result == 1); }
public static void GetMetatable(ScriptState luaState, string name) { ScriptApi.GetMetatable(luaState, name); }
public static void Atpanic(ScriptState luaState, ScriptFunctionHandler fn) { var ptr = ConvertDelegateToIntPtr(fn); ScriptApi.Atpanic(luaState, ptr); }
public static int SetHook(ScriptState luaState, EventMasks mask, int count) { return(ScriptApi.SetHook(luaState, (int)mask, count)); }
public static void RegisterMethod(ScriptState luaState, string methodName, ScriptFunctionHandler fn) { var ptr = ConvertDelegateToIntPtr(fn); ScriptApi.RegisterMethod(luaState, methodName, ptr); }
public static string SetLocal(ScriptState luaState, LuaDebug ar, int n) { CharPtr local = ScriptApi.SetLocal(luaState, ar, n); return(local.ToString()); }
public ScriptGalleryDetailViewModel(ScriptApi api, ScriptGalleryModel gallery) { Api = api; Gallery = gallery; Refresh(); }
public static void GlobalRawGet(ScriptState luaState, int index) { ScriptApi.GlobalRawGet(luaState, index); }
public ScriptGalleryReadingImage(string link, ScriptApi api, int index) { _link = link; _api = api; Index = index; }
protected override void Arrange() { _scriptApi = new ScriptApi(); }
public static void SetTableValue(ScriptState luaState, int index, Action <ScriptState> action) { ScriptApi.SetTableValue(luaState, index, ConvertDelegateToIntPtr(CreateNativeFunction(action))); }
public static int GetRef(ScriptState luaState, int index) { return(ScriptApi.GetRef(luaState, index)); }
public void BeforeEachTest() { _scriptApi = new ScriptApi(); }
public static int GetGlobalRef(ScriptState luaState, string globalName, ScriptTypes luaType) { return(ScriptApi.GetGlobalRef(luaState, globalName, (int)luaType)); }
public ScriptGalleryReadingViewModel(ScriptApi api, ScriptGalleryDetailModel detail) : base( detail.Title) { Api = api; Detail = detail; }