// Copyright 2022 Jamie Taylor
namespace StardewModdingAPI.Web.Framework.Clients.UpdateManifest
{
/// Metadata about a mod download in an update manifest file.
internal class UpdateManifestModDownload : GenericModDownload
{
/*********
** Fields
*********/
/// The update subkey for this mod download.
private readonly string Subkey;
/*********
** Public methods
*********/
/// Construct an instance.
/// The field name for this mod download in the manifest.
/// The mod name for this download.
/// The download's version.
/// The download's URL.
public UpdateManifestModDownload(string fieldName, string name, string? version, string? url)
: base(name, null, version, url)
{
this.Subkey = '@' + fieldName;
}
/// Get whether the subkey matches this download.
/// The update subkey to check.
public override bool MatchesSubkey(string subkey)
{
return subkey == this.Subkey;
}
}
}