feat: add a ModUtils::validate
moves the reading of mod files into `ModUtils` namespace Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
This commit is contained in:
@ -43,6 +43,7 @@
|
||||
|
||||
#include "MetadataHandler.h"
|
||||
#include "Version.h"
|
||||
#include "minecraft/mod/ModDetails.h"
|
||||
|
||||
Mod::Mod(const QFileInfo& file) : Resource(file), m_local_details()
|
||||
{
|
||||
@ -68,6 +69,10 @@ void Mod::setMetadata(std::shared_ptr<Metadata::ModStruct>&& metadata)
|
||||
m_local_details.metadata = metadata;
|
||||
}
|
||||
|
||||
void Mod::setDetails(const ModDetails& details) {
|
||||
m_local_details = details;
|
||||
}
|
||||
|
||||
std::pair<int, bool> Mod::compare(const Resource& other, SortType type) const
|
||||
{
|
||||
auto cast_other = dynamic_cast<Mod const*>(&other);
|
||||
@ -190,3 +195,8 @@ void Mod::finishResolvingWithDetails(ModDetails&& details)
|
||||
if (metadata)
|
||||
setMetadata(std::move(metadata));
|
||||
}
|
||||
|
||||
bool Mod::valid() const
|
||||
{
|
||||
return !m_local_details.mod_id.isEmpty();
|
||||
}
|
Reference in New Issue
Block a user