using System;
namespace StardewModdingAPI.Framework.Networking
{
/// Metadata about the game, SMAPI, and installed mods exchanged with connected computers.
internal class RemoteContextModel
{
/*********
** Accessors
*********/
/// Whether this player is the host player.
public bool IsHost { get; }
/// The game's platform.
public GamePlatform Platform { get; }
/// The installed version of Stardew Valley.
public ISemanticVersion? GameVersion { get; }
/// The installed version of SMAPI.
public ISemanticVersion? ApiVersion { get; }
/// The installed mods.
public RemoteContextModModel[] Mods { get; }
/*********
** Public methods
*********/
/// Construct an instance.
/// Whether this player is the host player.
/// The game's platform.
/// The installed version of Stardew Valley.
/// The installed version of SMAPI.
/// The installed mods.
public RemoteContextModel(bool isHost, GamePlatform platform, ISemanticVersion gameVersion, ISemanticVersion apiVersion, RemoteContextModModel[]? mods)
{
this.IsHost = isHost;
this.Platform = platform;
this.GameVersion = gameVersion;
this.ApiVersion = apiVersion;
this.Mods = mods ?? Array.Empty();
}
}
}