Skip to content

Commit

Permalink
Fixed Create Player
Browse files Browse the repository at this point in the history
  • Loading branch information
oneheed committed Aug 29, 2023
1 parent 90a56a4 commit 5edfe5c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
public class CreateGameRequest
{
public Guid PlayerId { get; set; }
public Guid? PlayerId { get; set; }

public string PlayerName { get; set; }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public async Task<GameModel> 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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public async Task<GameModel> 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);

Expand Down

0 comments on commit 5edfe5c

Please sign in to comment.