Before changing Piece[,] to Dictionary<string,Piece>
This commit is contained in:
30
Gameboard.ShogiUI.Sockets/Models/SessionMetadata.cs
Normal file
30
Gameboard.ShogiUI.Sockets/Models/SessionMetadata.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
namespace Gameboard.ShogiUI.Sockets.Models
|
||||
{
|
||||
/// <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; }
|
||||
public bool IsPrivate { get; }
|
||||
|
||||
public SessionMetadata(string name, bool isPrivate, string player1, string? player2)
|
||||
{
|
||||
Name = name;
|
||||
IsPrivate = isPrivate;
|
||||
Player1 = player1;
|
||||
Player2 = player2;
|
||||
}
|
||||
public SessionMetadata(Session sessionModel)
|
||||
{
|
||||
Name = sessionModel.Name;
|
||||
IsPrivate = sessionModel.IsPrivate;
|
||||
Player1 = sessionModel.Player1;
|
||||
Player2 = sessionModel.Player2;
|
||||
}
|
||||
|
||||
public ServiceModels.Socket.Types.Game ToServiceModel() => new(Name, Player1, Player2);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user