diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-06-05 20:22:46 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-06-05 20:22:46 -0400 |
commit | 625c538f244519700f3942b2b2969845db9a99b0 (patch) | |
tree | d13596220a62616838310cbcf0f0004e2f843da3 /src/StardewModdingAPI.Toolkit/Serialisation/Models/ManifestDependency.cs | |
parent | 265ce35fd1db677230ddb16483b4d92e7c13a777 (diff) | |
download | SMAPI-625c538f244519700f3942b2b2969845db9a99b0.tar.gz SMAPI-625c538f244519700f3942b2b2969845db9a99b0.tar.bz2 SMAPI-625c538f244519700f3942b2b2969845db9a99b0.zip |
move manifest parsing into toolkit (#532)
Diffstat (limited to 'src/StardewModdingAPI.Toolkit/Serialisation/Models/ManifestDependency.cs')
-rw-r--r-- | src/StardewModdingAPI.Toolkit/Serialisation/Models/ManifestDependency.cs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/StardewModdingAPI.Toolkit/Serialisation/Models/ManifestDependency.cs b/src/StardewModdingAPI.Toolkit/Serialisation/Models/ManifestDependency.cs new file mode 100644 index 00000000..d902f9ac --- /dev/null +++ b/src/StardewModdingAPI.Toolkit/Serialisation/Models/ManifestDependency.cs @@ -0,0 +1,35 @@ +namespace StardewModdingAPI.Toolkit.Serialisation.Models +{ + /// <summary>A mod dependency listed in a mod manifest.</summary> + public class ManifestDependency + { + /********* + ** Accessors + *********/ + /// <summary>The unique mod ID to require.</summary> + public string UniqueID { get; set; } + + /// <summary>The minimum required version (if any).</summary> + public SemanticVersion MinimumVersion { get; set; } + + /// <summary>Whether the dependency must be installed to use the mod.</summary> + public bool IsRequired { get; set; } + + + /********* + ** Public methods + *********/ + /// <summary>Construct an instance.</summary> + /// <param name="uniqueID">The unique mod ID to require.</param> + /// <param name="minimumVersion">The minimum required version (if any).</param> + /// <param name="required">Whether the dependency must be installed to use the mod.</param> + public ManifestDependency(string uniqueID, string minimumVersion, bool required = true) + { + this.UniqueID = uniqueID; + this.MinimumVersion = !string.IsNullOrWhiteSpace(minimumVersion) + ? new SemanticVersion(minimumVersion) + : null; + this.IsRequired = required; + } + } +} |