fix : unify dto conversion
This commit is contained in:
+15
-4
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user