34 lines
814 B
C#
34 lines
814 B
C#
using System.Collections.Generic;
|
|
|
|
namespace Gameboard.ShogiUI.Sockets.ServiceModels.Types
|
|
{
|
|
public class Game
|
|
{
|
|
public string Player1 { get; set; } = string.Empty;
|
|
public string? Player2 { get; set; } = string.Empty;
|
|
public string GameName { get; set; } = string.Empty;
|
|
/// <summary>
|
|
/// Players[0] is the session owner, Players[1] is the other person.
|
|
/// </summary>
|
|
public IReadOnlyList<string> Players
|
|
{
|
|
get
|
|
{
|
|
var list = new List<string>(2) { Player1 };
|
|
if (!string.IsNullOrEmpty(Player2)) list.Add(Player2);
|
|
return list;
|
|
}
|
|
}
|
|
|
|
public Game()
|
|
{
|
|
}
|
|
public Game(string gameName, string player1, string? player2 = null)
|
|
{
|
|
GameName = gameName;
|
|
Player1 = player1;
|
|
Player2 = player2;
|
|
}
|
|
}
|
|
}
|