mapper class and delete old stuff
This commit is contained in:
@@ -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; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace Gameboard.ShogiUI.Sockets.ServiceModels.Socket
|
||||
{
|
||||
public interface IResponse
|
||||
public interface ISocketResponse
|
||||
{
|
||||
string Action { get; }
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -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 };
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user