checkpoint

This commit is contained in:
2021-11-21 10:07:35 -06:00
parent cf3fbbbc1d
commit 433ab2772a
23 changed files with 1556 additions and 1487 deletions

View File

@@ -2,32 +2,37 @@
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 class Game
{
public string Player1 { get; set; }
public string? Player2 { get; set; }
public string GameName { get; set; } = string.Empty;
public Game()
{
}
public Game(string gameName, string player1, string? player2 = null)
{
GameName = gameName;
Player1 = player1;
Player2 = player2;
}
}
/// <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;
}
}
/// <summary>
/// Constructor for serialization.
/// </summary>
public Game()
{
}
public Game(string gameName, string player1, string? player2 = null)
{
GameName = gameName;
Player1 = player1;
Player2 = player2;
}
}
}