using System.Diagnostics.CodeAnalysis;
namespace StardewModdingAPI.Toolkit.Framework.Clients.Wiki
{
/// A mod entry in the wiki list.
public class WikiModEntry
{
/*********
** Accessors
*********/
/// The mod's unique ID. If the mod has alternate/old IDs, they're listed in latest to oldest order.
public string[] ID { get; }
/// The mod's display name. If the mod has multiple names, the first one is the most canonical name.
public string[] Name { get; }
/// The mod's author name. If the author has multiple names, the first one is the most canonical name.
public string[] Author { get; }
/// The mod ID on Nexus.
public int? NexusID { get; }
/// The mod ID in the Chucklefish mod repo.
public int? ChucklefishID { get; }
/// The mod ID in the CurseForge mod repo.
public int? CurseForgeID { get; }
/// The mod key in the CurseForge mod repo (used in mod page URLs).
public string? CurseForgeKey { get; }
/// The mod ID in the ModDrop mod repo.
public int? ModDropID { get; }
/// The GitHub repository in the form 'owner/repo'.
public string? GitHubRepo { get; }
/// The URL to a non-GitHub source repo.
public string? CustomSourceUrl { get; }
/// The custom mod page URL (if applicable).
public string? CustomUrl { get; }
/// The name of the mod which loads this content pack, if applicable.
public string? ContentPackFor { get; }
/// The mod's compatibility with the latest stable version of the game.
public WikiCompatibilityInfo Compatibility { get; }
/// The mod's compatibility with the latest beta version of the game (if any).
public WikiCompatibilityInfo? BetaCompatibility { get; }
/// Whether a Stardew Valley or SMAPI beta which affects mod compatibility is in progress. If this is true, should be used for beta versions of SMAPI instead of .
#if NET5_0_OR_GREATER
[MemberNotNullWhen(true, nameof(WikiModEntry.BetaCompatibility))]
#endif
public bool HasBetaInfo => this.BetaCompatibility != null;
/// The human-readable warnings for players about this mod.
public string[] Warnings { get; }
/// The URL of the pull request which submits changes for an unofficial update to the author, if any.
public string? PullRequestUrl { get; }
/// Special notes intended for developers who maintain unofficial updates or submit pull requests.
public string? DevNote { get; }
/// The data overrides to apply to the mod's manifest or remote mod page data, if any.
public WikiDataOverrideEntry? Overrides { get; }
/// The link anchor for the mod entry in the wiki compatibility list.
public string? Anchor { get; }
/*********
** Public methods
*********/
/// Construct an instance.
/// The mod's unique ID. If the mod has alternate/old IDs, they're listed in latest to oldest order.
/// The mod's display name. If the mod has multiple names, the first one is the most canonical name.
/// The mod's author name. If the author has multiple names, the first one is the most canonical name.
/// The mod ID on Nexus.
/// The mod ID in the Chucklefish mod repo.
/// The mod ID in the CurseForge mod repo.
/// The mod ID in the CurseForge mod repo.
/// The mod ID in the ModDrop mod repo.
/// The GitHub repository in the form 'owner/repo'.
/// The URL to a non-GitHub source repo.
/// The custom mod page URL (if applicable).
/// The name of the mod which loads this content pack, if applicable.
/// The mod's compatibility with the latest stable version of the game.
/// The mod's compatibility with the latest beta version of the game (if any).
/// The human-readable warnings for players about this mod.
/// The URL of the pull request which submits changes for an unofficial update to the author, if any.
/// Special notes intended for developers who maintain unofficial updates or submit pull requests.
/// The data overrides to apply to the mod's manifest or remote mod page data, if any.
/// The link anchor for the mod entry in the wiki compatibility list.
public WikiModEntry(string[] id, string[] name, string[] author, int? nexusId, int? chucklefishId, int? curseForgeId, string? curseForgeKey, int? modDropId, string? githubRepo, string? customSourceUrl, string? customUrl, string? contentPackFor, WikiCompatibilityInfo compatibility, WikiCompatibilityInfo? betaCompatibility, string[] warnings, string? pullRequestUrl, string? devNote, WikiDataOverrideEntry? overrides, string? anchor)
{
this.ID = id;
this.Name = name;
this.Author = author;
this.NexusID = nexusId;
this.ChucklefishID = chucklefishId;
this.CurseForgeID = curseForgeId;
this.CurseForgeKey = curseForgeKey;
this.ModDropID = modDropId;
this.GitHubRepo = githubRepo;
this.CustomSourceUrl = customSourceUrl;
this.CustomUrl = customUrl;
this.ContentPackFor = contentPackFor;
this.Compatibility = compatibility;
this.BetaCompatibility = betaCompatibility;
this.Warnings = warnings;
this.PullRequestUrl = pullRequestUrl;
this.DevNote = devNote;
this.Overrides = overrides;
this.Anchor = anchor;
}
}
}