Trabajando en el fichero de configuración

This commit is contained in:
2022-09-12 14:07:59 +02:00
parent 561f957bca
commit c5aa28d738
8 changed files with 275 additions and 25 deletions

View File

@@ -65,14 +65,14 @@ Room::~Room()
}
// Carga las variables desde un fichero
bool Room::load(std::string _file_path)
bool Room::load(std::string file_path)
{
// Indicador de éxito en la carga
bool success = true;
std::string filename = _file_path.substr(_file_path.find_last_of("\\/") + 1);
std::string filename = file_path.substr(file_path.find_last_of("\\/") + 1);
std::string line;
std::ifstream file(_file_path);
std::ifstream file(file_path);
// El fichero se puede abrir
if (file.good())
@@ -275,6 +275,7 @@ bool Room::setVars(std::string var, std::string value)
}
return success;
}
// Asigna variables a una estructura enemy_t