MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / compare

Method compare

launcher/minecraft/mod/ResourcePack.cpp:86–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84}
85
86std::pair<int, bool> ResourcePack::compare(const Resource& other, SortType type) const
87{
88 auto const& cast_other = static_cast<ResourcePack const&>(other);
89
90 switch (type) {
91 default: {
92 auto res = Resource::compare(other, type);
93 if (res.first != 0)
94 return res;
95 [[fallthrough]];
96 }
97 case SortType::PACK_FORMAT: {
98 auto this_ver = packFormat();
99 auto other_ver = cast_other.packFormat();
100
101 if (this_ver > other_ver)
102 return { 1, type == SortType::PACK_FORMAT };
103 if (this_ver < other_ver)
104 return { -1, type == SortType::PACK_FORMAT };
105 }
106 }
107 return { 0, false };
108}
109
110bool ResourcePack::applyFilter(QRegularExpression filter) const
111{

Callers

nothing calls this directly

Calls 1

packFormatMethod · 0.80

Tested by

no test coverage detected