summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/Models/ManifestDependency.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2017-10-07 23:07:10 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2017-10-07 23:07:10 -0400
commit929dccb75a1405737975d76648e015a3e7c00177 (patch)
tree659fe16509327e694555db363caf7f47f326443b /src/SMAPI/Framework/Models/ManifestDependency.cs
parent926894f8f52c2a5cf104fcac2f7f34b637f7b531 (diff)
downloadSMAPI-929dccb75a1405737975d76648e015a3e7c00177.tar.gz
SMAPI-929dccb75a1405737975d76648e015a3e7c00177.tar.bz2
SMAPI-929dccb75a1405737975d76648e015a3e7c00177.zip
reorganise repo structure
Diffstat (limited to 'src/SMAPI/Framework/Models/ManifestDependency.cs')
-rw-r--r--src/SMAPI/Framework/Models/ManifestDependency.cs34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/SMAPI/Framework/Models/ManifestDependency.cs b/src/SMAPI/Framework/Models/ManifestDependency.cs
new file mode 100644
index 00000000..5646b335
--- /dev/null
+++ b/src/SMAPI/Framework/Models/ManifestDependency.cs
@@ -0,0 +1,34 @@
+namespace StardewModdingAPI.Framework.Models
+{
+ /// <summary>A mod dependency listed in a mod manifest.</summary>
+ internal class ManifestDependency : IManifestDependency
+ {
+ /*********
+ ** Accessors
+ *********/
+ /// <summary>The unique mod ID to require.</summary>
+ public string UniqueID { get; set; }
+
+ /// <summary>The minimum required version (if any).</summary>
+ public ISemanticVersion 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;
+ }
+ }
+}