LuaInterface.LuaDLL.lua_rawgeti C# (CSharp) Method

lua_rawgeti() private method

private lua_rawgeti ( IntPtr luaState, int tableIndex, System.Int64 index ) : void
luaState System.IntPtr
tableIndex int
index System.Int64
return void
        public static extern void lua_rawgeti(IntPtr luaState, int tableIndex, Int64 index);

Same methods

LuaDLL::lua_rawgeti ( IntPtr luaState, int tableIndex, int index ) : void

Usage Example

示例#1
0
        public static string[] CheckStringArray(IntPtr L, int stackPos)
        {
            LuaTypes luatype = LuaDLL.lua_type(L, stackPos);

            if (luatype == LuaTypes.LUA_TTABLE)
            {
                int           index  = 1;
                string        retVal = null;
                Type          t      = typeof(string);
                List <string> list   = new List <string>();
                LuaDLL.lua_pushvalue(L, stackPos);

                while (true)
                {
                    LuaDLL.lua_rawgeti(L, -1, index);
                    luatype = LuaDLL.lua_type(L, -1);

                    if (luatype == LuaTypes.LUA_TNIL)
                    {
                        LuaDLL.lua_pop(L, 1);
                        return(list.ToArray());
                    }
                    else if (!TypeChecker.CheckType(L, t, -1))
                    {
                        LuaDLL.lua_pop(L, 1);
                        break;
                    }

                    retVal = ToString(L, -1);
                    list.Add(retVal);
                    LuaDLL.lua_pop(L, 1);
                    ++index;
                }
            }
            else if (luatype == LuaTypes.LUA_TUSERDATA)
            {
                return((string[])CheckObject(L, stackPos, typeof(string[])));
            }
            else if (luatype == LuaTypes.LUA_TNIL)
            {
                return(null);
            }

            LuaDLL.luaL_typerror(L, stackPos, "string[]");
            return(null);
        }
All Usage Examples Of LuaInterface.LuaDLL::lua_rawgeti
LuaDLL