internal LuaDataProvider( LuaFunction function, SafeLua luaState, LuaDataFactory dataFactory, LuaTable self = null) { _luaFunction = function; _luaState = luaState; _dataFactory = dataFactory; _selfTable = self; }
/// <summary> /// Constructs a new LuaDataContainer wrapping a native lua table /// and using a safe lua state. /// </summary> /// <param name="table">Lua table to wrap.</param> /// <param name="luaState">Safe lua state to access the table.</param> /// <param name="factory"></param> internal LuaDataContainer(LuaTable table, SafeLua luaState, LuaDataFactory factory) { _luaState = luaState; _luaTable = table; _dataFactory = factory; // If the table is a proxy, the inner table needs to be recovered // in order to enable enumerating, because proxy tables handled by // the Wherigo Lua engine cannot be enumerated. _selfLuaTable = _luaState.SafeGetFieldInMetatable <LuaTable>(_luaTable, "_self") ?? _luaTable; }
internal FriendLuaDataProvider(LuaFunction func, SafeLua lua, LuaDataFactory factory, LuaTable self) : base(func, lua, factory, self) { }
internal FriendLuaDataContainer(LuaTable table, SafeLua lua, LuaDataFactory factory) : base(table, lua, factory) { }