checkpoint
This commit is contained in:
@@ -8,7 +8,7 @@ namespace Gameboard.ShogiUI.Sockets.ServiceModels.Types
|
||||
public Dictionary<string, Piece?> Board { get; set; } = new Dictionary<string, Piece?>();
|
||||
public IReadOnlyCollection<Piece> Player1Hand { get; set; } = Array.Empty<Piece>();
|
||||
public IReadOnlyCollection<Piece> Player2Hand { get; set; } = Array.Empty<Piece>();
|
||||
public WhichPlayer? PlayerInCheck { get; set; }
|
||||
public WhichPlayer WhoseTurn { get; set; }
|
||||
public WhichPerspective? PlayerInCheck { get; set; }
|
||||
public WhichPerspective WhoseTurn { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,6 @@
|
||||
{
|
||||
public bool IsPromoted { get; set; }
|
||||
public WhichPiece WhichPiece { get; set; }
|
||||
public WhichPlayer Owner { get; set; }
|
||||
public WhichPerspective Owner { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
9
Gameboard.ShogiUI.Sockets.ServiceModels/Types/User.cs
Normal file
9
Gameboard.ShogiUI.Sockets.ServiceModels/Types/User.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace Gameboard.ShogiUI.Sockets.ServiceModels.Types
|
||||
{
|
||||
public class User
|
||||
{
|
||||
public string Id { get; set; } = string.Empty;
|
||||
|
||||
public string Name { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace Gameboard.ShogiUI.Sockets.ServiceModels.Types
|
||||
{
|
||||
public enum WhichPerspective
|
||||
{
|
||||
Player1,
|
||||
Player2,
|
||||
Spectator
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
namespace Gameboard.ShogiUI.Sockets.ServiceModels.Types
|
||||
{
|
||||
public enum WhichPlayer
|
||||
{
|
||||
Player1,
|
||||
Player2
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user