fix : unify dto conversion

This commit is contained in:
2024-12-30 00:39:06 +01:00
parent e9d5d8d909
commit cdddb9a073
8 changed files with 54 additions and 21 deletions
+15 -4
View File
@@ -3,12 +3,17 @@ import { PlayerResponseDTO } from './dto/playerresponse.dto';
export class LobbyCreateEvent {
type = 'create';
constructor(public game: GameResponseDTO) {}
game: GameResponseDTO;
constructor(game: GameResponseDTO) {
this.game = new GameResponseDTO(game);
}
}
export class LobbyStartEvent {
type = 'start';
constructor(public game: GameResponseDTO) {}
constructor(public game: GameResponseDTO) {
this.game = new GameResponseDTO(game);
}
}
export class LobbyDeleteEvent {
@@ -21,7 +26,10 @@ export class LobbyJoinEvent {
constructor(
public player: PlayerResponseDTO,
public game: GameResponseDTO,
) {}
) {
this.player = new PlayerResponseDTO(player);
this.game = new GameResponseDTO(game);
}
}
export class LobbyLeaveEvent {
@@ -30,5 +38,8 @@ export class LobbyLeaveEvent {
constructor(
public player: PlayerResponseDTO,
public game: GameResponseDTO,
) {}
) {
this.player = new PlayerResponseDTO(player);
this.game = new GameResponseDTO(game);
}
}