@ -41,8 +41,31 @@ std::pair<Version, Version> ResourcePack::compatibleVersions() const
|
||||
// but if we did and we still don't have a valid pack format, that's a bit concerning.
|
||||
Q_ASSERT(!isResolved());
|
||||
|
||||
return {{}, {}};
|
||||
return { {}, {} };
|
||||
}
|
||||
|
||||
return s_pack_format_versions.constFind(m_pack_format).value();
|
||||
}
|
||||
|
||||
std::pair<int, bool> ResourcePack::compare(const Resource& other, SortType type) const
|
||||
{
|
||||
auto const& cast_other = static_cast<ResourcePack const&>(other);
|
||||
|
||||
switch (type) {
|
||||
default: {
|
||||
auto res = Resource::compare(other, type);
|
||||
if (res.first != 0)
|
||||
return res;
|
||||
}
|
||||
case SortType::PACK_FORMAT: {
|
||||
auto this_ver = packFormat();
|
||||
auto other_ver = cast_other.packFormat();
|
||||
|
||||
if (this_ver > other_ver)
|
||||
return { 1, type == SortType::PACK_FORMAT };
|
||||
if (this_ver < other_ver)
|
||||
return { -1, type == SortType::PACK_FORMAT };
|
||||
}
|
||||
}
|
||||
return { 0, false };
|
||||
}
|
||||
|
Reference in New Issue
Block a user