diff --git a/src/Application/Gaas.GobbletGobblers.Application/UseCases/CreateGameRequest.cs b/src/Application/Gaas.GobbletGobblers.Application/UseCases/CreateGameRequest.cs index 4306551..8528022 100644 --- a/src/Application/Gaas.GobbletGobblers.Application/UseCases/CreateGameRequest.cs +++ b/src/Application/Gaas.GobbletGobblers.Application/UseCases/CreateGameRequest.cs @@ -2,7 +2,7 @@ { public class CreateGameRequest { - public Guid PlayerId { get; set; } + public Guid? PlayerId { get; set; } public string PlayerName { get; set; } } diff --git a/src/Application/Gaas.GobbletGobblers.Application/UseCases/CreateGameUseCase.cs b/src/Application/Gaas.GobbletGobblers.Application/UseCases/CreateGameUseCase.cs index 18fc67c..c24c444 100644 --- a/src/Application/Gaas.GobbletGobblers.Application/UseCases/CreateGameUseCase.cs +++ b/src/Application/Gaas.GobbletGobblers.Application/UseCases/CreateGameUseCase.cs @@ -16,7 +16,7 @@ public async Task ExecuteAsync(CreateGameRequest request, IRepository throw new Exception(); // 改 - var player = new Player(request.PlayerId); + var player = request.PlayerId == null ? new Player() : new Player(request.PlayerId.Value); player.Nameself(request.PlayerName); game = new Game(); diff --git a/src/Application/Gaas.GobbletGobblers.Application/UseCases/JoinGameRequest.cs b/src/Application/Gaas.GobbletGobblers.Application/UseCases/JoinGameRequest.cs index 7dd10b6..b05215a 100644 --- a/src/Application/Gaas.GobbletGobblers.Application/UseCases/JoinGameRequest.cs +++ b/src/Application/Gaas.GobbletGobblers.Application/UseCases/JoinGameRequest.cs @@ -4,7 +4,7 @@ public class JoinGameRequest { public Guid Id { get; set; } - public Guid PlayerId { get; set; } + public Guid? PlayerId { get; set; } public string PlayerName { get; set; } } diff --git a/src/Application/Gaas.GobbletGobblers.Application/UseCases/JoinGameUseCase.cs b/src/Application/Gaas.GobbletGobblers.Application/UseCases/JoinGameUseCase.cs index 75aab19..dbf1cfb 100644 --- a/src/Application/Gaas.GobbletGobblers.Application/UseCases/JoinGameUseCase.cs +++ b/src/Application/Gaas.GobbletGobblers.Application/UseCases/JoinGameUseCase.cs @@ -14,7 +14,7 @@ public async Task ExecuteAsync(JoinGameRequest request, IRepository r throw new Exception(); // 改 - var player = new Player(request.PlayerId); + var player = request.PlayerId == null ? new Player() : new Player(request.PlayerId.Value); player.Nameself(request.PlayerName); game.JoinPlayer(player);