From 6813bf31ce85606da65853665b7946cb732d43b4 Mon Sep 17 00:00:00 2001 From: legonzaur Date: Sun, 29 Dec 2024 12:08:15 +0100 Subject: [PATCH] remove events --- events/dto/conceptinturnresponse.dto.ts | 20 -------------- events/dto/conceptresponse.dto.ts | 13 --------- events/dto/gameresponse.dto.ts | 36 ------------------------- events/dto/playerresponse.dto.ts | 16 ----------- events/dto/userresponse.dto.ts | 16 ----------- events/dto/wordresponse.dto.ts | 18 ------------- events/lobby.events.ts | 21 --------------- events/word.events.ts | 26 ------------------ 8 files changed, 166 deletions(-) delete mode 100644 events/dto/conceptinturnresponse.dto.ts delete mode 100644 events/dto/conceptresponse.dto.ts delete mode 100644 events/dto/gameresponse.dto.ts delete mode 100644 events/dto/playerresponse.dto.ts delete mode 100644 events/dto/userresponse.dto.ts delete mode 100644 events/dto/wordresponse.dto.ts delete mode 100644 events/lobby.events.ts delete mode 100644 events/word.events.ts diff --git a/events/dto/conceptinturnresponse.dto.ts b/events/dto/conceptinturnresponse.dto.ts deleted file mode 100644 index 0b82ac6..0000000 --- a/events/dto/conceptinturnresponse.dto.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { Expose, Type } from 'class-transformer'; -import { ConceptResponseDTO } from './conceptresponse.dto'; - -export class ConceptInTurnResponseDTO { - constructor(partial: Partial) { - Object.assign(this, partial); - } - @Type(() => ConceptResponseDTO) - @Expose() - concept: ConceptResponseDTO; - - @Expose() - order: number; - - @Expose() - subconcept: number; - - @Expose() - markers: number; -} diff --git a/events/dto/conceptresponse.dto.ts b/events/dto/conceptresponse.dto.ts deleted file mode 100644 index ed508fb..0000000 --- a/events/dto/conceptresponse.dto.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Expose } from 'class-transformer'; - -export class ConceptResponseDTO { - constructor(partial: Partial) { - Object.assign(this, partial); - } - - @Expose() - id: number; - - @Expose() - value: string; -} diff --git a/events/dto/gameresponse.dto.ts b/events/dto/gameresponse.dto.ts deleted file mode 100644 index b3f755c..0000000 --- a/events/dto/gameresponse.dto.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { Expose, Type } from 'class-transformer'; -import { UserResponseDTO } from './userresponse.dto'; -import { PlayerResponseDTO } from './playerresponse.dto'; -import { ConceptInTurnResponseDTO } from './conceptinturnresponse.dto'; - -export class GameResponseDTO { - constructor(partial: Partial) { - Object.assign(this, partial); - this.owner = partial.owner; - this.players = partial.players; - this.currentPlayer = partial.currentPlayer; - this.currentConcepts = partial.currentConcepts; - } - - @Expose() - id: number; - - @Type(() => UserResponseDTO) - @Expose() - owner: UserResponseDTO; - - @Type(() => PlayerResponseDTO) - @Expose() - players: PlayerResponseDTO[]; - - @Type(() => PlayerResponseDTO) - @Expose() - currentPlayer: PlayerResponseDTO; - - @Expose() - started: boolean; - - @Type(() => ConceptInTurnResponseDTO) - @Expose() - currentConcepts: ConceptInTurnResponseDTO[]; -} diff --git a/events/dto/playerresponse.dto.ts b/events/dto/playerresponse.dto.ts deleted file mode 100644 index 4ac8a53..0000000 --- a/events/dto/playerresponse.dto.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Expose, Type } from 'class-transformer'; -import { UserResponseDTO } from './userresponse.dto'; - -export class PlayerResponseDTO { - constructor(partial: Partial) { - Object.assign(this, partial); - this.user = partial.user; - } - - @Type(() => UserResponseDTO) - @Expose() - user: UserResponseDTO; - - @Expose() - score: number; -} diff --git a/events/dto/userresponse.dto.ts b/events/dto/userresponse.dto.ts deleted file mode 100644 index 5825d8b..0000000 --- a/events/dto/userresponse.dto.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Expose } from 'class-transformer'; - -export class UserResponseDTO { - constructor(partial: Partial) { - Object.assign(this, partial); - this.id = partial.id; - } - @Expose() - id: string; - - @Expose() - username: string; - - @Expose() - avatar: string; -} diff --git a/events/dto/wordresponse.dto.ts b/events/dto/wordresponse.dto.ts deleted file mode 100644 index 2d84c37..0000000 --- a/events/dto/wordresponse.dto.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Expose } from 'class-transformer'; - -export class WordResponseDTO { - constructor(partial: Partial) { - Object.assign(this, partial); - } - @Expose() - id: number; - - @Expose() - value: string; - - @Expose() - ownerId: string; - - @Expose() - enabled: boolean; -} diff --git a/events/lobby.events.ts b/events/lobby.events.ts deleted file mode 100644 index 3a98aa2..0000000 --- a/events/lobby.events.ts +++ /dev/null @@ -1,21 +0,0 @@ -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, - ) { - this.gameId = game.id; - } -} diff --git a/events/word.events.ts b/events/word.events.ts deleted file mode 100644 index 7a901c1..0000000 --- a/events/word.events.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { WordResponseDTO } from './dto/wordresponse.dto'; - -export class WordCreateEvent { - type: 'create'; - constructor(public word: WordResponseDTO) {} -} - -export class WordEditEvent { - type: 'edit'; - constructor(public word: WordResponseDTO) {} -} - -export class WordDeleteEvent { - type: 'delete'; - constructor(public id: number) {} -} - -export class WordEnableEvent { - type: 'enable'; - constructor(public id: number) {} -} - -export class WordDisableEvent { - type: 'disable'; - constructor(public id: number) {} -}