BOLTStack.Lua.lua_settop C# (CSharp) Method

lua_settop() private method

private lua_settop ( IntPtr luaState, int newTop ) : void
luaState System.IntPtr
newTop int
return void
        public static extern void lua_settop(IntPtr luaState, int newTop);

Usage Example

Esempio n. 1
0
        public static Tuple <T1, T2, T3> GetTuple <T1, T2, T3>(
            this IntPtr L,
            int index,
            Func <IntPtr, int, T1> getor1,
            Func <IntPtr, int, T2> getor2,
            Func <IntPtr, int, T3> getor3)
        {
            int _lastTopIndex = Lua.lua_gettop(L);

            //Get First Item
            Lua.lua_rawgeti(L, index, 1);
            var value1 = getor1(L, -1);

            Lua.lua_settop(L, _lastTopIndex);

            //Get Second Item
            Lua.lua_rawgeti(L, index, 2);
            var value2 = getor2(L, -1);

            Lua.lua_settop(L, _lastTopIndex);

            //Get Thrird Item
            Lua.lua_rawgeti(L, index, 3);
            var value3 = getor3(L, -1);

            Lua.lua_settop(L, _lastTopIndex);

            return(Tuple.Create(value1, value2, value3));
        }
All Usage Examples Of BOLTStack.Lua::lua_settop