int GameVar::getSubVarAsInt(const char *name) { GameVar *var = getSubVarByName(name); if (var) return var->_value.intValue; else return 0; }
int GameVar::getSubVarAsInt(const Common::String &name) { GameVar *var = getSubVarByName(name); if (var) return var->_value.intValue; else return 0; }
GameVar *GameVar::addSubVarAsInt(const Common::String &name, int value) { if (getSubVarByName(name)) { return 0; } else { GameVar *var = new GameVar(); var->_varType = 0; var->_value.intValue = value; var->_varName = name; return (addSubVar(var) != 0) ? var : 0; } }
GameVar *GameVar::addSubVarAsInt(const char *name, int value) { if (getSubVarByName(name)) { return 0; } else { GameVar *var = new GameVar(); var->_varType = 0; var->_value.intValue = value; var->_varName = (char *)calloc(strlen(name) + 1, 1); strcpy(var->_varName, name); return (addSubVar(var) != 0) ? var : 0; } }
bool GameVar::setSubVarAsInt(const Common::String &name, int value) { GameVar *var = getSubVarByName(name); if (var) { if (var->_varType == 0) { var->_value.intValue = value; return true; } return false; } var = new GameVar(); var->_varType = 0; var->_value.intValue = value; var->_varName = name; return addSubVar(var); }
bool GameVar::setSubVarAsInt(const char *name, int value) { GameVar *var = getSubVarByName(name); if (var) { if (var->_varType == 0) { var->_value.intValue = value; return true; } return false; } var = new GameVar(); var->_varType = 0; var->_value.intValue = value; var->_varName = (char *)calloc(strlen(name) + 1, 1); strcpy(var->_varName, name); return addSubVar(var); }