I have the following nested table defined in Lua. I need to pass it into my C++ program so that I can accurately read it's values. I know I can pass a single table to Lua using the
lua_getglobal(L, "parameters")
function. But in this case since it is nested, how can I deal with it?
parameters =
{
fuel = 100,
damage = 250,
maxspeed = 250,
levels =
{
{
fuel = 200,
damage = 600,
maxspeed = 300,
},
{
fuel = 300,
damage = 750,
maxspeed = 400,
},
}
}