Skip to content

Commit

Permalink
Add Game
Browse files Browse the repository at this point in the history
  • Loading branch information
oneheed committed Aug 29, 2023
1 parent a55000a commit 90a56a4
Show file tree
Hide file tree
Showing 9 changed files with 407 additions and 2 deletions.
11 changes: 11 additions & 0 deletions src/Application/Gaas.GobbletGobblers.Application/GameModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,15 @@ public class ErrorResult
{
public string Message { get; set; }
}


public class User
{
public string Id { get; set; }

public string Email { get; set; }

public string NickName { get; set; }
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
{
public class CreateGameRequest
{
public Guid PlayerId { get; set; }

public string PlayerName { get; set; }
}
}
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();
var player = new Player(request.PlayerId);
player.Nameself(request.PlayerName);

game = new Game();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ public class JoinGameRequest
{
public Guid Id { get; set; }

public Guid PlayerId { get; set; }

public string PlayerName { get; set; }
}
}
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();
var player = new Player(request.PlayerId);
player.Nameself(request.PlayerName);
game.JoinPlayer(player);

Expand Down
5 changes: 5 additions & 0 deletions src/Domain/Gaas.GobbletGobblers.Domain/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ public Player()
this.Id = Guid.NewGuid();
}

public Player(Guid guid)
{
this.Id = guid;
}

public Player Nameself(string name)
{
this.Name = name;
Expand Down
Loading

0 comments on commit 90a56a4

Please sign in to comment.