diff options
author | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2022-12-10 00:52:50 -0700 |
---|---|---|
committer | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2022-12-24 09:42:02 -0700 |
commit | 878614ff68163bbc95cbfc35611765f21a83bfed (patch) | |
tree | 93e9994abeee5be25cde63e8d2eb6f353d7da868 /launcher/minecraft/mod/Mod.cpp | |
parent | 25e23e50cadf8e72105ca70e347d65595d2d3f16 (diff) | |
download | PrismLauncher-878614ff68163bbc95cbfc35611765f21a83bfed.tar.gz PrismLauncher-878614ff68163bbc95cbfc35611765f21a83bfed.tar.bz2 PrismLauncher-878614ff68163bbc95cbfc35611765f21a83bfed.zip |
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>
Diffstat (limited to 'launcher/minecraft/mod/Mod.cpp')
-rw-r--r-- | launcher/minecraft/mod/Mod.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
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::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(); +}
\ No newline at end of file |