added string extraction method

This commit is contained in:
devZoGok
2022-07-03 16:06:31 +03:00
parent 8e9c4d6e84
commit 56cd618b46
2 changed files with 11 additions and 0 deletions
+8
View File
@@ -36,6 +36,14 @@ namespace gameBase{
return var;
}
string LuaManager::getString(string varName){
lua_getglobal(state, varName.c_str());
string result = lua_tostring(state, -1);
lua_pop(state, 1);
return result;
}
void LuaManager::prepareTableForRetrieval(string table, vector<Index> &indices){
lua_getglobal(state, table.c_str());