namespace StardewModdingAPI.Framework.Models
{
/// A mod dependency listed in a mod manifest.
internal class ManifestDependency : IManifestDependency
{
/*********
** Accessors
*********/
/// The unique mod ID to require.
public string UniqueID { get; set; }
/// The minimum required version (if any).
public ISemanticVersion MinimumVersion { get; set; }
#if !SMAPI_1_x
/// Whether the dependency must be installed to use the mod.
public bool IsRequired { get; set; }
#endif
/*********
** Public methods
*********/
/// Construct an instance.
/// The unique mod ID to require.
/// The minimum required version (if any).
/// Whether the dependency must be installed to use the mod.
public ManifestDependency(string uniqueID, string minimumVersion
#if !SMAPI_1_x
, bool required = true
#endif
)
{
this.UniqueID = uniqueID;
this.MinimumVersion = !string.IsNullOrWhiteSpace(minimumVersion)
? new SemanticVersion(minimumVersion)
: null;
#if !SMAPI_1_x
this.IsRequired = required;
#endif
}
}
}