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++); } }
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++); } }
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); } }