fix : assign event type in class

This commit is contained in:
2024-12-29 12:14:08 +01:00
parent 03d4a1ba26
commit f9623a7961
2 changed files with 17 additions and 15 deletions
+7 -5
View File
@@ -2,20 +2,22 @@ import { GameResponseDTO } from './dto/gameresponse.dto';
import { PlayerResponseDTO } from './dto/playerresponse.dto';
export class GameCreateEvent extends GameResponseDTO {
type: 'create';
type = 'create';
}
export class GameDeleteEvent {
type: 'delete';
constructor(public id?: number) {}
type = 'delete';
constructor(public id?: number) { }
}
export class GameJoinEvent {
type: 'joingame';
type = 'joingame';
gameId: number;
constructor(
public player: PlayerResponseDTO,
game?: Partial<GameResponseDTO>,
) {
this.gameId = game.id;
if (game && game.id) {
this.gameId = game.id;
}
}
}