using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; namespace StardewModdingAPI { /// Metadata about a connected player. public interface IMultiplayerPeer { /********* ** Accessors *********/ /// The player's unique ID. long PlayerID { get; } /// Whether this is a connection to the host player. bool IsHost { get; } /// Whether this a local player on the same computer in split-screen mote. bool IsSplitScreen { get; } /// Whether the player has SMAPI installed. [MemberNotNullWhen(true, nameof(IMultiplayerPeer.Platform), nameof(IMultiplayerPeer.GameVersion), nameof(IMultiplayerPeer.ApiVersion), nameof(IMultiplayerPeer.Mods))] bool HasSmapi { get; } /// The player's screen ID, if applicable. /// See for details. This is only visible to players in split-screen mode. A remote player won't see this value, even if the other players are in split-screen mode. int? ScreenID { get; } /// The player's OS platform, if is true. GamePlatform? Platform { get; } /// The installed version of Stardew Valley, if is true. ISemanticVersion? GameVersion { get; } /// The installed version of SMAPI, if is true. ISemanticVersion? ApiVersion { get; } /// The installed mods, if is true. IEnumerable Mods { get; } /********* ** Methods *********/ /// Get metadata for a mod installed by the player. /// The unique mod ID. /// Returns the mod info, or null if the player doesn't have that mod. IMultiplayerPeerMod? GetMod(string? id); } }