pollymc/logic/minecraft/forge/ForgeVersion.cpp

56 lines
1.0 KiB
C++
Raw Normal View History

#include "ForgeVersion.h"
2015-02-09 06:21:14 +05:30
#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-05 03:40:59 +05:30
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;
}