aboutsummaryrefslogtreecommitdiff
path: root/launcher/minecraft/mod/ModDetails.h
diff options
context:
space:
mode:
authorSefa Eyeoglu <contact@scrumplex.net>2022-08-28 16:52:53 +0200
committerGitHub <noreply@github.com>2022-08-28 16:52:53 +0200
commitf371ec210c091b9ebc91930be74752383cb941c6 (patch)
treef3b13e1015285e76145552d21503ff641bf4ce11 /launcher/minecraft/mod/ModDetails.h
parentafcd669d2f6934c2b6076939d7665f791d495994 (diff)
parent0b81b283bfdd16b409127f22eac7b51ce0142929 (diff)
downloadPrismLauncher-f371ec210c091b9ebc91930be74752383cb941c6.tar.gz
PrismLauncher-f371ec210c091b9ebc91930be74752383cb941c6.tar.bz2
PrismLauncher-f371ec210c091b9ebc91930be74752383cb941c6.zip
Merge pull request #1052 from flowln/resource_model
Diffstat (limited to 'launcher/minecraft/mod/ModDetails.h')
-rw-r--r--launcher/minecraft/mod/ModDetails.h61
1 files changed, 52 insertions, 9 deletions
diff --git a/launcher/minecraft/mod/ModDetails.h b/launcher/minecraft/mod/ModDetails.h
index 3e0a7ab0..dd84b0a3 100644
--- a/launcher/minecraft/mod/ModDetails.h
+++ b/launcher/minecraft/mod/ModDetails.h
@@ -46,34 +46,77 @@ enum class ModStatus {
Installed, // Both JAR and Metadata are present
NotInstalled, // Only the Metadata is present
NoMetadata, // Only the JAR is present
+ Unknown, // Default status
};
struct ModDetails
{
/* Mod ID as defined in the ModLoader-specific metadata */
- QString mod_id;
+ QString mod_id = {};
/* Human-readable name */
- QString name;
+ QString name = {};
/* Human-readable mod version */
- QString version;
+ QString version = {};
/* Human-readable minecraft version */
- QString mcversion;
+ QString mcversion = {};
/* URL for mod's home page */
- QString homeurl;
+ QString homeurl = {};
/* Human-readable description */
- QString description;
+ QString description = {};
/* List of the author's names */
- QStringList authors;
+ QStringList authors = {};
/* Installation status of the mod */
- ModStatus status;
+ ModStatus status = ModStatus::Unknown;
/* Metadata information, if any */
- std::shared_ptr<Metadata::ModStruct> metadata;
+ std::shared_ptr<Metadata::ModStruct> metadata = nullptr;
+
+ ModDetails() = default;
+
+ /** Metadata should be handled manually to properly set the mod status. */
+ ModDetails(ModDetails& other)
+ : mod_id(other.mod_id)
+ , name(other.name)
+ , version(other.version)
+ , mcversion(other.mcversion)
+ , homeurl(other.homeurl)
+ , description(other.description)
+ , authors(other.authors)
+ , status(other.status)
+ {}
+
+ ModDetails& operator=(ModDetails& other)
+ {
+ this->mod_id = other.mod_id;
+ this->name = other.name;
+ this->version = other.version;
+ this->mcversion = other.mcversion;
+ this->homeurl = other.homeurl;
+ this->description = other.description;
+ this->authors = other.authors;
+ this->status = other.status;
+
+ return *this;
+ }
+
+ ModDetails& operator=(ModDetails&& other)
+ {
+ this->mod_id = other.mod_id;
+ this->name = other.name;
+ this->version = other.version;
+ this->mcversion = other.mcversion;
+ this->homeurl = other.homeurl;
+ this->description = other.description;
+ this->authors = other.authors;
+ this->status = other.status;
+
+ return *this;
+ }
};