Files
Shogi/Shogi.Domain/SessionMetadata.cs

29 lines
658 B
C#

namespace Shogi.Domain
{
/// <summary>
/// A representation of a Session without the board and game-rules.
/// </summary>
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;
}
}