diff options
Diffstat (limited to 'src/StardewModdingAPI/Framework/Models/ManifestDependency.cs')
-rw-r--r-- | src/StardewModdingAPI/Framework/Models/ManifestDependency.cs | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/StardewModdingAPI/Framework/Models/ManifestDependency.cs b/src/StardewModdingAPI/Framework/Models/ManifestDependency.cs index 2f580c1d..25d92a29 100644 --- a/src/StardewModdingAPI/Framework/Models/ManifestDependency.cs +++ b/src/StardewModdingAPI/Framework/Models/ManifestDependency.cs @@ -9,15 +9,34 @@ /// <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; } + +#if SMAPI_2_0 + /// <summary>Whether the dependency must be installed to use the mod.</summary> + public bool IsRequired { get; set; } +#endif /********* ** Public methods *********/ /// <summary>Construct an instance.</summary> /// <param name="uniqueID">The unique mod ID to require.</param> - public ManifestDependency(string uniqueID) + /// <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 +#if SMAPI_2_0 + , bool required = true +#endif + ) { this.UniqueID = uniqueID; + this.MinimumVersion = !string.IsNullOrWhiteSpace(minimumVersion) + ? new SemanticVersion(minimumVersion) + : null; +#if SMAPI_2_0 + this.IsRequired = required; +#endif } } } |