一维
role_type= {"rule","npc","building"}
int
luaEx_TestGetTable (LuaState
*
L)
{
LuaStack args(L);
int index = L -> GetTop();
L -> PushNil();
while ( 0 != L -> Next(index))
{
const char * str = lua_tostring(L -> GetCState(), - 1 );
L -> Pop( 1 );
}
return 0 ;
}
{
LuaStack args(L);
int index = L -> GetTop();
L -> PushNil();
while ( 0 != L -> Next(index))
{
const char * str = lua_tostring(L -> GetCState(), - 1 );
L -> Pop( 1 );
}
return 0 ;
}
二维
role_type2= {{"rule","npc","building"}}
int
luaEx_TestGetTable (LuaState
*
L)
{
LuaStack args(L);
int index = L -> GetTop();
L -> PushNil();
while ( 0 != L -> Next(index))
{
const char * str = lua_tostring(L -> GetCState(), - 1 );;
int index1 = L -> GetTop();
L -> PushNil();
while ( 0 != L -> Next(index1))
{
const char * str1 = lua_tostring(L -> GetCState(), - 1 );
L -> Pop( 1 );
}
L -> Pop( 1 );
}
return 0 ;
}
{
LuaStack args(L);
int index = L -> GetTop();
L -> PushNil();
while ( 0 != L -> Next(index))
{
const char * str = lua_tostring(L -> GetCState(), - 1 );;
int index1 = L -> GetTop();
L -> PushNil();
while ( 0 != L -> Next(index1))
{
const char * str1 = lua_tostring(L -> GetCState(), - 1 );
L -> Pop( 1 );
}
L -> Pop( 1 );
}
return 0 ;
}