This commit is contained in:
2023-01-28 13:21:47 -06:00
parent 11b387b928
commit 8a25c0ed35
26 changed files with 443 additions and 359 deletions

View File

@@ -4,15 +4,17 @@ namespace Shogi.Contracts.Socket;
public class PlayerHasMovedMessage : ISocketResponse
{
public SocketAction Action { get; }
public string SessionName { get; set; }
/// <summary>
/// The player that made the move.
/// </summary>
public string PlayerName { get; set; }
public SocketAction Action { get; }
public string SessionName { get; set; }
/// <summary>
/// The player that made the move.
/// </summary>
public string PlayerName { get; set; }
public PlayerHasMovedMessage()
{
Action = SocketAction.PieceMoved;
}
public PlayerHasMovedMessage()
{
Action = SocketAction.PieceMoved;
SessionName = string.Empty;
PlayerName = string.Empty;
}
}

View File

@@ -4,10 +4,5 @@ namespace Shogi.Contracts.Socket;
public class SessionCreatedSocketMessage : ISocketResponse
{
public SocketAction Action { get; }
public SessionCreatedSocketMessage()
{
Action = SocketAction.SessionCreated;
}
public SocketAction Action => SocketAction.SessionCreated;
}

View File

@@ -0,0 +1,9 @@
using Shogi.Contracts.Types;
namespace Shogi.Contracts.Socket
{
public class SessionJoinedByPlayerSocketMessage : ISocketResponse
{
public SocketAction Action => SocketAction.SessionJoined;
}
}