generated from legonzaur/webapp-dto
Initial commit
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
import { GameResponseDTO } from "./dto/gameresponse.dto";
|
||||
import { PlayerResponseDTO } from "./dto/playerresponse.dto";
|
||||
import type { ConceptEvent } from "./events";
|
||||
|
||||
export class LobbyCreateEvent implements ConceptEvent {
|
||||
type = "create";
|
||||
game: GameResponseDTO;
|
||||
constructor(game: GameResponseDTO) {
|
||||
this.game = new GameResponseDTO(game);
|
||||
}
|
||||
}
|
||||
|
||||
export class LobbyStartEvent implements ConceptEvent {
|
||||
type = "start";
|
||||
constructor(public game: GameResponseDTO) {
|
||||
this.game = new GameResponseDTO(game);
|
||||
}
|
||||
}
|
||||
|
||||
export class LobbyDeleteEvent implements ConceptEvent {
|
||||
type = "delete";
|
||||
constructor(public id: number) {}
|
||||
}
|
||||
|
||||
export class LobbyJoinEvent implements ConceptEvent {
|
||||
type = "joingame";
|
||||
constructor(
|
||||
public player: PlayerResponseDTO,
|
||||
public game: GameResponseDTO,
|
||||
) {
|
||||
this.player = new PlayerResponseDTO(player);
|
||||
this.game = new GameResponseDTO(game);
|
||||
}
|
||||
}
|
||||
|
||||
export class LobbyLeaveEvent implements ConceptEvent {
|
||||
type = "leavegame";
|
||||
gameId?: number;
|
||||
constructor(
|
||||
public player: PlayerResponseDTO,
|
||||
public game: GameResponseDTO,
|
||||
) {
|
||||
this.player = new PlayerResponseDTO(player);
|
||||
this.game = new GameResponseDTO(game);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user