PrismLauncher/logic/forge/ForgeVersion.cpp

56 lines
1.0 KiB
C++
Raw Normal View History

#include "ForgeVersion.h"
2015-02-09 00:51:14 +00:00
#include "minecraft/VersionFilterData.h"
#include <QObject>
QString ForgeVersion::name()
{
return "Forge " + jobbuildver;
}
QString ForgeVersion::descriptor()
{
return universal_filename;
}
QString ForgeVersion::typeString() const
{
if (is_recommended)
return QObject::tr("Recommended");
return QString();
}
bool ForgeVersion::operator<(BaseVersion &a)
{
ForgeVersion *pa = dynamic_cast<ForgeVersion *>(&a);
if (!pa)
return true;
return m_buildnr < pa->m_buildnr;
}
bool ForgeVersion::operator>(BaseVersion &a)
{
ForgeVersion *pa = dynamic_cast<ForgeVersion *>(&a);
if (!pa)
return false;
return m_buildnr > pa->m_buildnr;
}
bool ForgeVersion::usesInstaller()
{
if(installer_url.isEmpty())
return false;
2014-05-04 23:10:59 +01:00
if(g_VersionFilterData.forgeInstallerBlacklist.contains(mcver))
return false;
return true;
}
QString ForgeVersion::filename()
{
return usesInstaller() ? installer_filename : universal_filename;
}
QString ForgeVersion::url()
{
return usesInstaller() ? installer_url : universal_url;
}