2014-09-19 20:23:21 +03:00
|
|
|
#include "gamedetails.h"
|
2014-09-19 21:08:46 +03:00
|
|
|
#include "util.h"
|
2014-09-19 20:23:21 +03:00
|
|
|
|
2014-09-19 21:08:46 +03:00
|
|
|
gameDetails::gameDetails()
|
2014-09-19 20:23:21 +03:00
|
|
|
{
|
|
|
|
//ctor
|
|
|
|
}
|
|
|
|
|
|
|
|
gameDetails::~gameDetails()
|
|
|
|
{
|
|
|
|
//dtor
|
2014-09-19 21:08:46 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
void gameDetails::makeFilepaths(const Config& config)
|
|
|
|
{
|
|
|
|
std::string filepath;
|
2014-09-19 22:46:03 +03:00
|
|
|
std::string directory = config.sDirectory + "/" + config.sGameSubdir + "/";
|
|
|
|
std::string subdir;
|
2014-09-19 21:08:46 +03:00
|
|
|
|
|
|
|
for (unsigned int i = 0; i < this->installers.size(); ++i)
|
|
|
|
{
|
2014-09-19 22:46:03 +03:00
|
|
|
subdir = config.bSubDirectories ? config.sInstallersSubdir : "";
|
|
|
|
filepath = Util::makeFilepath(directory, this->installers[i].path, this->gamename, subdir, this->installers[i].platform);
|
2014-09-19 21:08:46 +03:00
|
|
|
this->installers[i].setFilepath(filepath);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (unsigned int i = 0; i < this->extras.size(); ++i)
|
|
|
|
{
|
2014-09-19 22:46:03 +03:00
|
|
|
subdir = config.bSubDirectories ? config.sExtrasSubdir : "";
|
|
|
|
filepath = Util::makeFilepath(directory, this->extras[i].path, this->gamename, subdir, 0);
|
2014-09-19 21:08:46 +03:00
|
|
|
this->extras[i].setFilepath(filepath);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (unsigned int i = 0; i < this->patches.size(); ++i)
|
|
|
|
{
|
2014-09-19 22:46:03 +03:00
|
|
|
subdir = config.bSubDirectories ? config.sPatchesSubdir : "";
|
|
|
|
filepath = Util::makeFilepath(directory, this->patches[i].path, this->gamename, subdir, this->patches[i].platform);
|
2014-09-19 21:08:46 +03:00
|
|
|
this->patches[i].setFilepath(filepath);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (unsigned int i = 0; i < this->languagepacks.size(); ++i)
|
|
|
|
{
|
2014-09-19 22:46:03 +03:00
|
|
|
subdir = config.bSubDirectories ? config.sLanguagePackSubdir : "";
|
|
|
|
filepath = Util::makeFilepath(directory, this->languagepacks[i].path, this->gamename, subdir, 0);
|
2014-10-11 02:44:22 +03:00
|
|
|
this->languagepacks[i].setFilepath(filepath);
|
2014-09-19 21:08:46 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
for (unsigned int i = 0; i < this->dlcs.size(); ++i)
|
|
|
|
{
|
|
|
|
for (unsigned int j = 0; j < this->dlcs[i].installers.size(); ++j)
|
|
|
|
{
|
2014-09-19 22:46:03 +03:00
|
|
|
subdir = config.bSubDirectories ? config.sDLCSubdir + "/" + config.sInstallersSubdir : "";
|
|
|
|
filepath = Util::makeFilepath(directory, this->dlcs[i].installers[j].path, this->gamename, subdir, this->dlcs[i].installers[j].platform, this->dlcs[i].gamename);
|
2014-09-19 21:08:46 +03:00
|
|
|
this->dlcs[i].installers[j].setFilepath(filepath);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (unsigned int j = 0; j < this->dlcs[i].patches.size(); ++j)
|
|
|
|
{
|
2014-09-19 22:46:03 +03:00
|
|
|
subdir = config.bSubDirectories ? config.sDLCSubdir + "/" + config.sPatchesSubdir : "";
|
|
|
|
filepath = Util::makeFilepath(directory, this->dlcs[i].patches[j].path, this->gamename, subdir, this->dlcs[i].patches[j].platform, this->dlcs[i].gamename);
|
2014-09-19 21:08:46 +03:00
|
|
|
this->dlcs[i].patches[j].setFilepath(filepath);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (unsigned int j = 0; j < this->dlcs[i].extras.size(); ++j)
|
|
|
|
{
|
2014-09-19 22:46:03 +03:00
|
|
|
subdir = config.bSubDirectories ? config.sDLCSubdir + "/" + config.sExtrasSubdir : "";
|
|
|
|
filepath = Util::makeFilepath(directory, this->dlcs[i].extras[j].path, this->gamename, subdir, 0, this->dlcs[i].gamename);
|
2014-09-19 21:08:46 +03:00
|
|
|
this->dlcs[i].extras[j].setFilepath(filepath);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|