24 lines
521 B
TypeScript
24 lines
521 B
TypeScript
import { GameResponseDTO } from './dto/gameresponse.dto';
|
|
import { PlayerResponseDTO } from './dto/playerresponse.dto';
|
|
|
|
export class GameCreateEvent extends GameResponseDTO {
|
|
type = 'create';
|
|
}
|
|
|
|
export class GameDeleteEvent {
|
|
type = 'delete';
|
|
constructor(public id?: number) { }
|
|
}
|
|
export class GameJoinEvent {
|
|
type = 'joingame';
|
|
gameId?: number;
|
|
constructor(
|
|
public player: PlayerResponseDTO,
|
|
game?: Partial<GameResponseDTO>,
|
|
) {
|
|
if (game && game.id) {
|
|
this.gameId = game.id;
|
|
}
|
|
}
|
|
}
|