From 878614ff68163bbc95cbfc35611765f21a83bfed Mon Sep 17 00:00:00 2001 From: Rachel Powers <508861+Ryex@users.noreply.github.com> Date: Sat, 10 Dec 2022 00:52:50 -0700 Subject: 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> --- launcher/minecraft/mod/Mod.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'launcher/minecraft/mod/Mod.cpp') diff --git a/launcher/minecraft/mod/Mod.cpp b/launcher/minecraft/mod/Mod.cpp index 39023f69..8b00354d 100644 --- a/launcher/minecraft/mod/Mod.cpp +++ b/launcher/minecraft/mod/Mod.cpp @@ -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) m_local_details.metadata = metadata; } +void Mod::setDetails(const ModDetails& details) { + m_local_details = details; +} + std::pair Mod::compare(const Resource& other, SortType type) const { auto cast_other = dynamic_cast(&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(); +} \ No newline at end of file -- cgit