create, read, playercount

This commit is contained in:
2022-11-09 16:08:04 -06:00
parent a1f996e508
commit da76917490
37 changed files with 999 additions and 814 deletions

View File

@@ -5,6 +5,5 @@ namespace Shogi.Contracts.Api;
public class CreateSessionCommand
{
[Required]
public string Name { get; set; } = string.Empty;
public bool IsPrivate { get; set; }
public string Name { get; set; }
}

View File

@@ -3,7 +3,7 @@ using System.Collections.Generic;
namespace Shogi.Contracts.Api;
public class ReadAllSessionsResponse
public class ReadSessionsPlayerCountResponse
{
public IList<SessionMetadata> PlayerHasJoinedSessions { get; set; }
public IList<SessionMetadata> AllOtherSessions { get; set; }

View File

@@ -0,0 +1,11 @@
using System.Text.Json;
namespace Shogi.Contracts;
public class ShogiApiJsonSerializerSettings
{
public readonly static JsonSerializerOptions SystemTextJsonSerializerOptions = new(JsonSerializerDefaults.Web)
{
WriteIndented = true,
};
}

View File

@@ -2,9 +2,8 @@
public class Session
{
public string Player1 { get; set; } = string.Empty;
public string Player1 { get; set; }
public string? Player2 { get; set; }
public string SessionName { get; set; } = string.Empty;
public bool GameOver { get; set; }
public string SessionName { get; set; }
public BoardState BoardState { get; set; }
}