summaryrefslogtreecommitdiff
path: root/src/SMAPI/IMultiplayerPeer.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-04-13 20:24:14 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-04-13 20:24:14 -0400
commitf39da383a17b368e92fd243cf155b27ba42671f3 (patch)
tree56c215dfb34da270a7714afd141e76a94c69a2c0 /src/SMAPI/IMultiplayerPeer.cs
parent6e9e8aef1ef97e1a4ef4410ce300cb1c47eca986 (diff)
downloadSMAPI-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/IMultiplayerPeer.cs')
-rw-r--r--src/SMAPI/IMultiplayerPeer.cs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/SMAPI/IMultiplayerPeer.cs b/src/SMAPI/IMultiplayerPeer.cs
index e487f100..8b0062b5 100644
--- a/src/SMAPI/IMultiplayerPeer.cs
+++ b/src/SMAPI/IMultiplayerPeer.cs
@@ -1,6 +1,5 @@
-#nullable disable
-
using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
namespace StardewModdingAPI
{
@@ -20,6 +19,7 @@ namespace StardewModdingAPI
bool IsSplitScreen { get; }
/// <summary>Whether the player has SMAPI installed.</summary>
+ [MemberNotNullWhen(true, nameof(IMultiplayerPeer.Platform), nameof(IMultiplayerPeer.GameVersion), nameof(IMultiplayerPeer.ApiVersion), nameof(IMultiplayerPeer.Mods))]
bool HasSmapi { get; }
/// <summary>The player's screen ID, if applicable.</summary>
@@ -30,10 +30,10 @@ namespace StardewModdingAPI
GamePlatform? Platform { get; }
/// <summary>The installed version of Stardew Valley, if <see cref="HasSmapi"/> is true.</summary>
- ISemanticVersion GameVersion { get; }
+ ISemanticVersion? GameVersion { get; }
/// <summary>The installed version of SMAPI, if <see cref="HasSmapi"/> is true.</summary>
- ISemanticVersion ApiVersion { get; }
+ ISemanticVersion? ApiVersion { get; }
/// <summary>The installed mods, if <see cref="HasSmapi"/> is true.</summary>
IEnumerable<IMultiplayerPeerMod> Mods { get; }
@@ -45,6 +45,6 @@ namespace StardewModdingAPI
/// <summary>Get metadata for a mod installed by the player.</summary>
/// <param name="id">The unique mod ID.</param>
/// <returns>Returns the mod info, or <c>null</c> if the player doesn't have that mod.</returns>
- IMultiplayerPeerMod GetMod(string id);
+ IMultiplayerPeerMod? GetMod(string? id);
}
}