lua_next() private method

private lua_next ( IntPtr luaState, int index ) : int
luaState System.IntPtr
index int
return int
示例#1
0
        public ListDictionary GetTableDict(LuaTable table)
        {
            ListDictionary listDictionary = new ListDictionary();
            int            newTop         = LuaDLL.lua_gettop(this.L);

            this.translator.push(this.L, table);
            LuaDLL.lua_pushnil(this.L);
            while (LuaDLL.lua_next(this.L, -2) != 0)
            {
                listDictionary[this.translator.getObject(this.L, -2)] = this.translator.getObject(this.L, -1);
                LuaDLL.lua_settop(this.L, -2);
            }
            LuaDLL.lua_settop(this.L, newTop);
            return(listDictionary);
        }
示例#2
0
        public ListDictionary GetTableDict(LuaTable table)
        {
            ListDictionary dict = new ListDictionary();

            int oldTop = LuaDLL.lua_gettop(L);

            translator.Push(L, table);
            LuaDLL.lua_pushnil(L);
            while (LuaDLL.lua_next(L, -2) != 0)
            {
                dict[translator.GetObject(L, -2)] = translator.GetObject(L, -1);
                LuaDLL.lua_settop(L, -2);
            }
            LuaDLL.lua_settop(L, oldTop);

            return(dict);
        }
示例#3
0
 public bool LuaNext(int index)
 {
     return(LuaDLL.lua_next(L, index) != 0);
 }