using System.Diagnostics.CodeAnalysis;
namespace StardewModdingAPI.Toolkit.Serialization.Models
{
/// Indicates which mod can read the content pack represented by the containing manifest.
public class ManifestContentPackFor : IManifestContentPackFor
{
/*********
** Accessors
*********/
/// The unique ID of the mod which can read this content pack.
public string UniqueID { get; }
/// The minimum required version (if any).
public ISemanticVersion? MinimumVersion { get; }
/*********
** Public methods
*********/
/// Construct an instance.
/// The unique ID of the mod which can read this content pack.
/// The minimum required version (if any).
public ManifestContentPackFor(string uniqueId, ISemanticVersion? minimumVersion)
{
this.UniqueID = this.NormalizeWhitespace(uniqueId);
this.MinimumVersion = minimumVersion;
}
/*********
** Private methods
*********/
/// Normalize whitespace in a raw string.
/// The input to strip.
#if NET5_0_OR_GREATER
[return: NotNullIfNotNull("input")]
#endif
private string? NormalizeWhitespace(string? input)
{
return input?.Trim();
}
}
}