mirror of
https://github.com/devZoGok/gameBase.git
synced 2026-08-26 19:43:28 +00:00
new method
This commit is contained in:
@@ -36,6 +36,14 @@ namespace gameBase{
|
||||
return var;
|
||||
}
|
||||
|
||||
float LuaManager::getFloat(string varName){
|
||||
lua_getglobal(state, varName.c_str());
|
||||
int isNum;
|
||||
float var = (int)lua_tonumberx(state, -1, &isNum);
|
||||
lua_pop(state, 1);
|
||||
return var;
|
||||
}
|
||||
|
||||
string LuaManager::getString(string varName){
|
||||
lua_getglobal(state, varName.c_str());
|
||||
string result = lua_tostring(state, -1);
|
||||
|
||||
@@ -35,6 +35,7 @@ namespace gameBase{
|
||||
inline lua_State* getState(){return state;}
|
||||
void buildScript(std::vector<std::string>);
|
||||
int getInt(std::string);
|
||||
float getFloat(std::string);
|
||||
int getIntFromTable(std::string, std::vector<Index>);
|
||||
bool getBoolFromTable(std::string, std::vector<Index>);
|
||||
float getFloatFromTable(std::string, std::vector<Index>);
|
||||
|
||||
Reference in New Issue
Block a user