namespace Shogi.Domain { /// /// A representation of a Session without the board and game-rules. /// public class SessionMetadata { public string Name { get; } public string Player1 { get; } public string? Player2 { get; private set; } public bool IsPrivate { get; } public SessionMetadata(string name, bool isPrivate, string player1, string? player2 = null) { Name = name; IsPrivate = isPrivate; Player1 = player1; Player2 = player2; } public void SetPlayer2(string user) { Player2 = user; } public bool IsSeated(string playerName) => playerName == Player1 || playerName == Player2; } }