#nullable disable
using StardewModdingAPI.Toolkit.Framework.Clients.Wiki;
namespace StardewModdingAPI.Web.ViewModels
{
/// Metadata about a mod's compatibility with the latest versions of SMAPI and Stardew Valley.
public class ModCompatibilityModel
{
/*********
** Accessors
*********/
/// The compatibility status, as a string like "Broken".
public string Status { get; set; }
/// The human-readable summary, as an HTML block.
public string Summary { get; set; }
/// The game or SMAPI version which broke this mod (if applicable).
public string BrokeIn { get; set; }
/// A link to the unofficial version which fixes compatibility, if any.
public ModLinkModel UnofficialVersion { get; set; }
/*********
** Public methods
*********/
/// Construct an instance.
/// The mod metadata.
public ModCompatibilityModel(WikiCompatibilityInfo info)
{
this.Status = info.Status.ToString();
this.Status = this.Status.Substring(0, 1).ToLower() + this.Status.Substring(1);
this.Summary = info.Summary;
this.BrokeIn = info.BrokeIn;
if (info.UnofficialVersion != null)
this.UnofficialVersion = new ModLinkModel(info.UnofficialUrl, info.UnofficialVersion.ToString());
}
}
}