Files
Shogi/Gameboard.ShogiUI.Sockets/Repositories/CouchModels/Session.cs
2021-05-08 10:26:04 -05:00

31 lines
816 B
C#

namespace Gameboard.ShogiUI.Sockets.Repositories.CouchModels
{
public class Session : CouchDocument
{
public string Name { get; set; }
public string Player1 { get; set; }
public string? Player2 { get; set; }
public bool IsPrivate { get; set; }
/// <summary>
/// Default constructor and setters are for deserialization.
/// </summary>
public Session() : base()
{
Name = string.Empty;
Player1 = string.Empty;
Player2 = string.Empty;
}
public Session(string id, Models.Session session) : base(id, nameof(Session))
{
Name = session.Name;
Player1 = session.Player1;
Player2 = session.Player2;
IsPrivate = session.IsPrivate;
}
public Models.Session ToDomainModel() => new(Name, IsPrivate, Player1, Player2);
}
}