mapper class and delete old stuff

This commit is contained in:
2022-06-12 21:45:46 -05:00
parent 4ca0b63564
commit ab8d0c4c7c
39 changed files with 325 additions and 818 deletions

View File

@@ -1,11 +1,11 @@
using Gameboard.ShogiUI.Sockets.ServiceModels.Types;
using System.Collections.ObjectModel;
using System.Collections.Generic;
namespace Gameboard.ShogiUI.Sockets.ServiceModels.Api
{
public class GetSessionsResponse
{
public Collection<Session> PlayerHasJoinedSessions { get; set; }
public Collection<Session> AllOtherSessions { get; set; }
public IList<SessionMetadata> PlayerHasJoinedSessions { get; set; }
public IList<SessionMetadata> AllOtherSessions { get; set; }
}
}

View File

@@ -1,12 +1,11 @@
using Gameboard.ShogiUI.Sockets.ServiceModels.Types;
using System;
namespace Gameboard.ShogiUI.Sockets.ServiceModels.Socket
{
public class CreateGameResponse : IResponse
public class CreateGameResponse : ISocketResponse
{
public string Action { get; }
public Session Game { get; set; }
public SessionMetadata Game { get; set; }
/// <summary>
/// The player who created the game.

View File

@@ -1,6 +1,6 @@
namespace Gameboard.ShogiUI.Sockets.ServiceModels.Socket
{
public interface IResponse
public interface ISocketResponse
{
string Action { get; }
}

View File

@@ -14,7 +14,7 @@ namespace Gameboard.ShogiUI.Sockets.ServiceModels.Socket
public string GameName { get; set; } = "";
}
public class JoinGameResponse : IResponse
public class JoinGameResponse : ISocketResponse
{
public string Action { get; protected set; }
public string GameName { get; set; }
@@ -31,7 +31,7 @@ namespace Gameboard.ShogiUI.Sockets.ServiceModels.Socket
}
}
public class JoinByCodeResponse : JoinGameResponse, IResponse
public class JoinByCodeResponse : JoinGameResponse, ISocketResponse
{
public JoinByCodeResponse()
{

View File

@@ -2,7 +2,7 @@
namespace Gameboard.ShogiUI.Sockets.ServiceModels.Socket
{
public class MoveResponse : IResponse
public class MoveResponse : ISocketResponse
{
public string Action { get; }
public string GameName { get; set; }

View File

@@ -0,0 +1,12 @@
namespace Gameboard.ShogiUI.Sockets.ServiceModels.Types
{
public class SessionMetadata
{
public string Name { get; set; }
public string Player1 { get; set; }
public string? Player2 { get; set; }
public bool IsPrivate { get; set; }
public string[] Players => string.IsNullOrEmpty(Player2) ? new[] { Player1 } : new[] { Player1, Player2 };
}
}