public static void PushXLObjectList(this IntPtr L, string typeName, IEnumerable <int> handles) { XLLuaRuntime.lua_newtable(L); int i = 1; foreach (var handle in handles) { XLLuaRuntime.XLLRT_PushXLObject(L, typeName, new IntPtr(handle)); XLLuaRuntime.lua_rawseti(L, -2, i++); } }
public static void PushList(this IntPtr L, IEnumerable <double> list) { XLLuaRuntime.lua_newtable(L); int i = 1; foreach (var v in list) { Push(L, v); XLLuaRuntime.lua_rawseti(L, -2, i++); } }
public static void PushDictionary(this IntPtr L, Dictionary <int, Tuple <string, string, string, int> > dict) { XLLuaRuntime.lua_newtable(L); foreach (var pair in dict) { Push(L, pair.Key); XLLuaRuntime.lua_newtable(L); Push(L, pair.Value.Item1); XLLuaRuntime.lua_rawseti(L, -2, 1); Push(L, pair.Value.Item2); XLLuaRuntime.lua_rawseti(L, -2, 2); Push(L, pair.Value.Item3); XLLuaRuntime.lua_rawseti(L, -2, 3); Push(L, pair.Value.Item4); XLLuaRuntime.lua_rawseti(L, -2, 4); XLLuaRuntime.lua_settable(L, -3); } }