using System.Collections.Generic; using StardewModdingAPI.Framework.ModHelpers; using StardewModdingAPI.Framework.ModLoading; using StardewModdingAPI.Toolkit.Framework.Clients.WebApi; using StardewModdingAPI.Toolkit.Framework.ModData; using StardewModdingAPI.Toolkit.Framework.UpdateData; namespace StardewModdingAPI.Framework { /// Metadata for a mod. internal interface IModMetadata : IModInfo { /********* ** Accessors *********/ /// The mod's display name. string DisplayName { get; } /// The root path containing mods. string RootPath { get; } /// The mod's full directory path within the . string DirectoryPath { get; } /// The relative to the . string RelativeDirectoryPath { get; } /// Metadata about the mod from SMAPI's internal data (if any). ModDataRecordVersionedFields 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; } /// Whether the mod folder should be ignored. This is true if it was found within a folder whose name starts with a dot. bool IsIgnored { get; } /// The mod instance (if loaded and is false). IMod Mod { get; } /// The content pack instance (if loaded and is true). IContentPack ContentPack { get; } /// The translations for this mod (if loaded). TranslationHelper Translations { get; } /// Writes messages to the console and log file as this mod. IMonitor Monitor { get; } /// The mod-provided API (if any). object Api { 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. /// The translations for this mod (if loaded). IModMetadata SetMod(IMod mod, TranslationHelper translations); /// Set the mod instance. /// The contentPack instance to set. /// Writes messages to the console and log file. /// The translations for this mod (if loaded). IModMetadata SetMod(IContentPack contentPack, IMonitor monitor, TranslationHelper translations); /// 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 an ID (regardless of whether the ID is valid or the mod itself was loaded). bool HasID(); /// Whether the mod has the given ID. /// The mod ID to check. bool HasID(string id); /// Get the defined update keys. /// Only return valid update keys. IEnumerable GetUpdateKeys(bool validOnly = true); /// Whether the mod has at least one valid update key set. bool HasValidUpdateKeys(); /// Get whether the mod has a given warning and it hasn't been suppressed in the . /// The warning to check. bool HasUnsuppressWarning(ModWarning warning); /// Get a relative path which includes the root folder name. string GetRelativePathWithRoot(); } }