diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-04-13 20:24:14 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-04-13 20:24:14 -0400 |
commit | f39da383a17b368e92fd243cf155b27ba42671f3 (patch) | |
tree | 56c215dfb34da270a7714afd141e76a94c69a2c0 /src/SMAPI/Framework/IModMetadata.cs | |
parent | 6e9e8aef1ef97e1a4ef4410ce300cb1c47eca986 (diff) | |
download | SMAPI-f39da383a17b368e92fd243cf155b27ba42671f3.tar.gz SMAPI-f39da383a17b368e92fd243cf155b27ba42671f3.tar.bz2 SMAPI-f39da383a17b368e92fd243cf155b27ba42671f3.zip |
enable nullable annotations in SMAPI where no logic changes are needed (#837)
Diffstat (limited to 'src/SMAPI/Framework/IModMetadata.cs')
-rw-r--r-- | src/SMAPI/Framework/IModMetadata.cs | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/SMAPI/Framework/IModMetadata.cs b/src/SMAPI/Framework/IModMetadata.cs index 800b198a..7cee20b9 100644 --- a/src/SMAPI/Framework/IModMetadata.cs +++ b/src/SMAPI/Framework/IModMetadata.cs @@ -1,5 +1,3 @@ -#nullable disable - using System; using System.Collections.Generic; using StardewModdingAPI.Framework.ModHelpers; @@ -29,7 +27,7 @@ namespace StardewModdingAPI.Framework string RelativeDirectoryPath { get; } /// <summary>Metadata about the mod from SMAPI's internal data (if any).</summary> - ModDataRecordVersionedFields DataRecord { get; } + ModDataRecordVersionedFields? DataRecord { get; } /// <summary>The metadata resolution status.</summary> ModMetadataStatus Status { get; } @@ -41,31 +39,31 @@ namespace StardewModdingAPI.Framework ModWarning Warnings { get; } /// <summary>The reason the metadata is invalid, if any.</summary> - string Error { get; } + string? Error { get; } /// <summary>A detailed technical message for <see cref="Error"/>, if any.</summary> - public string ErrorDetails { get; } + string? ErrorDetails { get; } /// <summary>Whether the mod folder should be ignored. This is <c>true</c> if it was found within a folder whose name starts with a dot.</summary> bool IsIgnored { get; } /// <summary>The mod instance (if loaded and <see cref="IModInfo.IsContentPack"/> is false).</summary> - IMod Mod { get; } + IMod? Mod { get; } /// <summary>The content pack instance (if loaded and <see cref="IModInfo.IsContentPack"/> is true).</summary> - IContentPack ContentPack { get; } + IContentPack? ContentPack { get; } /// <summary>The translations for this mod (if loaded).</summary> - TranslationHelper Translations { get; } + TranslationHelper? Translations { get; } /// <summary>Writes messages to the console and log file as this mod.</summary> - IMonitor Monitor { get; } + IMonitor? Monitor { get; } /// <summary>The mod-provided API (if any).</summary> - object Api { get; } + object? Api { get; } /// <summary>The update-check metadata for this mod (if any).</summary> - ModEntryModel UpdateCheckData { get; } + ModEntryModel? UpdateCheckData { get; } /// <summary>The fake content packs created by this mod, if any.</summary> ISet<WeakReference<ContentPack>> FakeContentPacks { get; } @@ -84,7 +82,7 @@ namespace StardewModdingAPI.Framework /// <param name="error">The reason the metadata is invalid, if any.</param> /// <param name="errorDetails">A detailed technical message, if any.</param> /// <returns>Return the instance for chaining.</returns> - IModMetadata SetStatus(ModMetadataStatus status, ModFailReason reason, string error, string errorDetails = null); + IModMetadata SetStatus(ModMetadataStatus status, ModFailReason reason, string? error, string? errorDetails = null); /// <summary>Set a warning flag for the mod.</summary> /// <param name="warning">The warning to set.</param> @@ -103,7 +101,7 @@ namespace StardewModdingAPI.Framework /// <summary>Set the mod-provided API instance.</summary> /// <param name="api">The mod-provided API.</param> - IModMetadata SetApi(object api); + IModMetadata SetApi(object? api); /// <summary>Set the update-check metadata for this mod.</summary> /// <param name="data">The update-check metadata.</param> @@ -117,7 +115,7 @@ namespace StardewModdingAPI.Framework /// <summary>Whether the mod has the given ID.</summary> /// <param name="id">The mod ID to check.</param> - bool HasID(string id); + bool HasID(string? id); /// <summary>Get the defined update keys.</summary> /// <param name="validOnly">Only return valid update keys.</param> |