lua_rawseti() private method

private lua_rawseti ( IntPtr luaState, int idx, int n ) : void
luaState System.IntPtr
idx int
n int
return void
Esempio n. 1
0
        public static void PushXLObjectList(this IntPtr L, string typeName, IEnumerable <int> handles)
        {
            Lua.lua_newtable(L);
            int i = 1;

            foreach (var handle in handles)
            {
                XLLuaRuntime.XLLRT_PushXLObject(L, typeName, new IntPtr(handle));
                Lua.lua_rawseti(L, -2, i++);
            }
        }
Esempio n. 2
0
        public static void PushList(this IntPtr L, IEnumerable <double> list)
        {
            Lua.lua_newtable(L);
            int i = 1;

            foreach (var v in list)
            {
                Push(L, v);
                Lua.lua_rawseti(L, -2, i++);
            }
        }
Esempio n. 3
0
        public static void PushDictionary(this IntPtr L, Dictionary <int, Tuple <string, string, string, int> > dict)
        {
            Lua.lua_newtable(L);
            foreach (var pair in dict)
            {
                Push(L, pair.Key);

                Lua.lua_newtable(L);

                Push(L, pair.Value.Item1);
                Lua.lua_rawseti(L, -2, 1);

                Push(L, pair.Value.Item2);
                Lua.lua_rawseti(L, -2, 2);

                Push(L, pair.Value.Item3);
                Lua.lua_rawseti(L, -2, 3);

                Push(L, pair.Value.Item4);
                Lua.lua_rawseti(L, -2, 4);

                Lua.lua_settable(L, -3);
            }
        }