Ejemplo n.º 1
0
        private static int GetConstructorSignature(IntPtr luaState)
        {
            var state      = LuaState.FromIntPtr(luaState);
            var translator = ObjectTranslatorPool.Instance.Find(state);

            return(translator.GetConstructorSignatureInternal(state));
        }
Ejemplo n.º 2
0
        private static int ImportType(IntPtr luaState)
        {
            var state      = LuaState.FromIntPtr(luaState);
            var translator = ObjectTranslatorPool.Instance.Find(state);

            return(translator.ImportTypeInternal(state));
        }
Ejemplo n.º 3
0
        private static int UnregisterTable(IntPtr luaState)
        {
            var state      = LuaState.FromIntPtr(luaState);
            var translator = ObjectTranslatorPool.Instance.Find(state);

            return(translator.UnregisterTableInternal(state));
        }
Ejemplo n.º 4
0
        private static int LoadAssembly(IntPtr luaState)
        {
            var state      = LuaState.FromIntPtr(luaState);
            var translator = ObjectTranslatorPool.Instance.Find(state);

            return(translator.LoadAssemblyInternal(state));
        }
Ejemplo n.º 5
0
        static int PanicCallback(IntPtr state)
        {
            var    luaState = LuaState.FromIntPtr(state);
            string reason   = string.Format("Unprotected error in call to Lua API ({0})", luaState.ToString(-1));

            throw new LuaException(reason);
        }
Ejemplo n.º 6
0
        private static int PanicCallback(IntPtr state)
        {
            var luaState = LuaState.FromIntPtr(state);
            var reason   = $"Unprotected error in call to Lua API ({luaState.ToString(-1, false)})";

            throw new LuaException(reason);
        }
Ejemplo n.º 7
0
        private static int GetConstructorSignature(IntPtr luaState)
        {
            var state      = LuaState.FromIntPtr(luaState);
            var translator = ObjectTranslatorPool.Instance.Find(state);
            int result     = translator.GetConstructorSignatureInternal(state);
            var exception  = translator.GetObject(state, -1) as LuaScriptException;

            if (exception != null)
            {
                return(state.Error());
            }
            return(result);
        }
Ejemplo n.º 8
0
        static void DebugHookCallback(IntPtr luaState, IntPtr luaDebug)
        {
            var state = LuaState.FromIntPtr(luaState);

            state.GetStack(0, luaDebug);

            if (!state.GetInfo("Snlu", luaDebug))
            {
                return;
            }

            var debug = LuaDebug.FromIntPtr(luaDebug);

            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(state);
            Lua lua = translator.Interpreter;

            lua.DebugHookCallbackInternal(state, debug);
        }