using StardewModdingAPI.Framework.ModData; using StardewModdingAPI.Framework.ModLoading; using StardewModdingAPI.Toolkit.Framework.Clients.WebApi; namespace StardewModdingAPI.Framework { /// Metadata for a mod. internal interface IModMetadata { /********* ** Accessors *********/ /// The mod's display name. string DisplayName { get; } /// The mod's full directory path. string DirectoryPath { get; } /// The mod manifest. IManifest Manifest { get; } /// Metadata about the mod from SMAPI's internal data (if any). ParsedModDataRecord DataRecord { get; } /// The metadata resolution status. ModMetadataStatus Status { get; } /// Indicates non-error issues with the mod. ModWarning Warnings { get; } /// The reason the metadata is invalid, if any. string Error { get; } /// The mod instance (if loaded and is false). IMod Mod { get; } /// The content pack instance (if loaded and is true). IContentPack ContentPack { get; } /// Writes messages to the console and log file as this mod. IMonitor Monitor { get; } /// The mod-provided API (if any). object Api { get; } /// Whether the mod is a content pack. bool IsContentPack { get; } /// The update-check metadata for this mod (if any). ModEntryModel UpdateCheckData { get; } /********* ** Public methods *********/ /// Set the mod status. /// The metadata resolution status. /// The reason the metadata is invalid, if any. /// Return the instance for chaining. IModMetadata SetStatus(ModMetadataStatus status, string error = null); /// Set a warning flag for the mod. /// The warning to set. IModMetadata SetWarning(ModWarning warning); /// Set the mod instance. /// The mod instance to set. IModMetadata SetMod(IMod mod); /// Set the mod instance. /// The contentPack instance to set. /// Writes messages to the console and log file. IModMetadata SetMod(IContentPack contentPack, IMonitor monitor); /// Set the mod-provided API instance. /// The mod-provided API. IModMetadata SetApi(object api); /// Set the update-check metadata for this mod. /// The update-check metadata. IModMetadata SetUpdateData(ModEntryModel data); /// Whether the mod manifest was loaded (regardless of whether the mod itself was loaded). bool HasManifest(); /// Whether the mod has at least one update key set. bool HasUpdateKeys(); } }