Example #1
0
        public int Resume <T1>(T1 arg1)
        {
            luaState.Push(this);
            IntPtr L = luaState.LuaToThread(-1);

            luaState.LuaPop(1);
            StackTraits <T1> .Push(L, arg1);

            int ret = Resume(L, 1);

            if (ret == 0)
            {
                Dispose();
            }
            return(ret);
        }
Example #2
0
        public int Resume <R1>(out R1 ret1)
        {
            luaState.Push(this);
            IntPtr L = luaState.LuaToThread(-1);

            luaState.LuaPop(1);
            int ret = Resume(L, 0);

            if (ret == 0)
            {
                ret1 = default(R1);
                Dispose();
            }
            else
            {
                int top = LuaDLL.lua_gettop(L);
                ret1 = StackTraits <R1> .Check(L, top);
            }

            return(ret);
        }
Example #3
0
 internal void PushGeneric <T>(T arg)
 {
     StackTraits <T> .Push(L, arg);
 }
Example #4
0
 internal T CheckValue <T>(int stackPos)
 {
     return(StackTraits <T> .Check(L, stackPos));
 }
Example #5
0
        private void InitTypeTraits()
        {
            LuaStackOp op = new LuaStackOp();

            StackTraits <int> .Init(op.Push, op.CheckInt32, op.ToInt32);
        }