Lua/LuaInstance: Add [Check|Set][Field|Global] helpers

Former-commit-id: 4c6cb6097a28daa9099b3f00c201e49ec850c320
This commit is contained in:
Lynix
2015-12-17 13:47:25 +01:00
parent ee2626b928
commit 52599132a7
3 changed files with 122 additions and 12 deletions

View File

@@ -443,14 +443,14 @@ namespace Nz
return lua_absindex(m_state, index);
}
LuaType LuaInstance::GetField(const char* fieldName, int index) const
LuaType LuaInstance::GetField(const char* fieldName, int tableIndex) const
{
return FromLuaType(lua_getfield(m_state, index, fieldName));
return FromLuaType(lua_getfield(m_state, tableIndex, fieldName));
}
LuaType LuaInstance::GetField(const String& fieldName, int index) const
LuaType LuaInstance::GetField(const String& fieldName, int tableIndex) const
{
return FromLuaType(lua_getfield(m_state, index, fieldName.GetConstBuffer()));
return FromLuaType(lua_getfield(m_state, tableIndex, fieldName.GetConstBuffer()));
}
LuaType LuaInstance::GetGlobal(const char* name) const