Template
chore : cleanup lobby events
This commit is contained in:
+26
-15
@@ -1,23 +1,34 @@
|
|||||||
import { GameResponseDTO } from './dto/gameresponse.dto';
|
import { GameResponseDTO } from "./dto/gameresponse.dto";
|
||||||
import { PlayerResponseDTO } from './dto/playerresponse.dto';
|
import { PlayerResponseDTO } from "./dto/playerresponse.dto";
|
||||||
|
|
||||||
export class GameCreateEvent extends GameResponseDTO {
|
export class LobbyCreateEvent {
|
||||||
type = 'create';
|
type = "create";
|
||||||
|
constructor(public game: GameResponseDTO) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class GameDeleteEvent {
|
export class LobbyStartEvent {
|
||||||
type = 'delete';
|
type = "start";
|
||||||
constructor(public id?: number) { }
|
constructor(public game: GameResponseDTO) {}
|
||||||
}
|
}
|
||||||
export class GameJoinEvent {
|
|
||||||
type = 'joingame';
|
export class LobbyDeleteEvent {
|
||||||
|
type = "delete";
|
||||||
|
constructor(public id: number) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class LobbyJoinEvent {
|
||||||
|
type = "joingame";
|
||||||
|
constructor(
|
||||||
|
public player: PlayerResponseDTO,
|
||||||
|
public game: GameResponseDTO
|
||||||
|
) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class LobbyLeaveEvent {
|
||||||
|
type = "leavegame";
|
||||||
gameId?: number;
|
gameId?: number;
|
||||||
constructor(
|
constructor(
|
||||||
public player: PlayerResponseDTO,
|
public player: PlayerResponseDTO,
|
||||||
game?: Partial<GameResponseDTO>,
|
public game: GameResponseDTO
|
||||||
) {
|
) {}
|
||||||
if (game && game.id) {
|
|
||||||
this.gameId = game.id;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user