Beispiel #1
0
 public SafeDictionaryEnumerator(
     IEnumerator <KeyValuePair <LuaValue, LuaValue> > e,
     SafeLua parent)
 {
     this._baseEnumerator = e;
     this._parent         = parent;
     this._luaState       = _parent._luaState;
 }
 internal LuaDataFactory(IHelper helper)
 {
     _luaState = new SafeLua()
     {
         RethrowsExceptions            = true,
         RethrowsDisposedLuaExceptions = false
     };
     _helper = helper;
 }
Beispiel #3
0
 internal LuaDataProvider(
     LuaFunction function,
     SafeLua luaState,
     LuaDataFactory dataFactory,
     LuaTable self = null)
 {
     _luaFunction = function;
     _luaState    = luaState;
     _dataFactory = dataFactory;
     _selfTable   = self;
 }
Beispiel #4
0
        /// <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)
 {
 }