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/Mod.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/Mod.cs')
-rw-r--r-- | src/SMAPI/Mod.cs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/SMAPI/Mod.cs b/src/SMAPI/Mod.cs index 2b3750d5..cffe2998 100644 --- a/src/SMAPI/Mod.cs +++ b/src/SMAPI/Mod.cs @@ -1,5 +1,3 @@ -#nullable disable - using System; namespace StardewModdingAPI @@ -11,13 +9,13 @@ namespace StardewModdingAPI ** Accessors *********/ /// <inheritdoc /> - public IModHelper Helper { get; internal set; } + public IModHelper Helper { get; internal set; } = null!; /// <inheritdoc /> - public IMonitor Monitor { get; internal set; } + public IMonitor Monitor { get; internal set; } = null!; /// <inheritdoc /> - public IManifest ModManifest { get; internal set; } + public IManifest ModManifest { get; internal set; } = null!; /********* @@ -27,7 +25,7 @@ namespace StardewModdingAPI public abstract void Entry(IModHelper helper); /// <inheritdoc /> - public virtual object GetApi() + public virtual object? GetApi() { return null; } @@ -35,7 +33,7 @@ namespace StardewModdingAPI /// <summary>Release or reset unmanaged resources.</summary> public void Dispose() { - (this.Helper as IDisposable)?.Dispose(); // deliberate do this outside overridable dispose method so mods don't accidentally suppress it + (this.Helper as IDisposable)?.Dispose(); // deliberately do this outside overridable dispose method so mods don't accidentally suppress it this.Dispose(true); GC.SuppressFinalize(this); } |