chore: remove concept
This commit is contained in:
@@ -1,30 +0,0 @@
|
||||
import { ConceptResponseDTO } from "./dto/conceptresponse.dto";
|
||||
import type { ConceptEvent } from "./events";
|
||||
export class ConceptCreateEvent implements ConceptEvent {
|
||||
type = "create";
|
||||
constructor(public concept: ConceptResponseDTO) {
|
||||
this.concept = new ConceptResponseDTO(concept);
|
||||
}
|
||||
}
|
||||
|
||||
export class ConceptEditEvent implements ConceptEvent {
|
||||
type = "edit";
|
||||
constructor(public concept: ConceptResponseDTO) {
|
||||
this.concept = new ConceptResponseDTO(concept);
|
||||
}
|
||||
}
|
||||
|
||||
export class ConceptDeleteEvent implements ConceptEvent {
|
||||
type = "delete";
|
||||
constructor(public id: number) {}
|
||||
}
|
||||
|
||||
export class ConceptEnableEvent implements ConceptEvent {
|
||||
type = "enable";
|
||||
constructor(public id: number) {}
|
||||
}
|
||||
|
||||
export class ConceptDisableEvent implements ConceptEvent {
|
||||
type = "disable";
|
||||
constructor(public id: number) {}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
import { ConceptResponseDTO } from './conceptresponse.dto';
|
||||
|
||||
export class ConceptInTurnResponseDTO {
|
||||
constructor(partial: Partial<ConceptInTurnResponseDTO>) {
|
||||
this.order = partial.order;
|
||||
this.subconcept = partial.subconcept;
|
||||
this.markers = partial.markers;
|
||||
this.concept = new ConceptResponseDTO(partial.concept);
|
||||
}
|
||||
|
||||
concept: ConceptResponseDTO;
|
||||
|
||||
order: number;
|
||||
|
||||
subconcept: number;
|
||||
|
||||
markers: number;
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
import { ApiRequestTimeoutResponse } from '@nestjs/swagger';
|
||||
|
||||
export class ConceptResponseDTO {
|
||||
constructor(partial: Partial<ConceptResponseDTO>) {
|
||||
this.id = partial.id;
|
||||
this.value = partial.value;
|
||||
this.type = new ConceptTypeResponseDTO(partial.type);
|
||||
}
|
||||
|
||||
id: number;
|
||||
value: string;
|
||||
type: ConceptTypeResponseDTO;
|
||||
}
|
||||
|
||||
export class ConceptTypeResponseDTO {
|
||||
constructor(partial: Partial<ConceptTypeResponseDTO>) {
|
||||
this.id = partial.id;
|
||||
this.value = partial.value;
|
||||
}
|
||||
id: number;
|
||||
value: string;
|
||||
}
|
||||
@@ -1,6 +1,4 @@
|
||||
import { UserResponseDTO } from './userresponse.dto';
|
||||
import { PlayerResponseDTO } from './playerresponse.dto';
|
||||
import { ConceptInTurnResponseDTO } from './conceptinturnresponse.dto';
|
||||
import { MessageResponseDTO } from './messageresponse.dto';
|
||||
|
||||
export class GameResponseDTO {
|
||||
@@ -15,12 +13,6 @@ export class GameResponseDTO {
|
||||
this.players = partial.players.map((p) => new PlayerResponseDTO(p));
|
||||
}
|
||||
|
||||
if (partial.currentConcepts) {
|
||||
this.currentConcepts = partial.currentConcepts.map(
|
||||
(c) => new ConceptInTurnResponseDTO(c),
|
||||
);
|
||||
}
|
||||
|
||||
if (partial.currentPlayer) {
|
||||
this.currentPlayer = new PlayerResponseDTO(partial.currentPlayer);
|
||||
}
|
||||
@@ -36,7 +28,5 @@ export class GameResponseDTO {
|
||||
|
||||
started: boolean;
|
||||
|
||||
currentConcepts: ConceptInTurnResponseDTO[] = [];
|
||||
|
||||
messages: MessageResponseDTO[] = [];
|
||||
}
|
||||
|
||||
+10
-10
@@ -1,46 +1,46 @@
|
||||
import { MessageResponseDTO } from "./dto/messageresponse.dto";
|
||||
import { PlayerResponseDTO } from "./dto/playerresponse.dto";
|
||||
import type { ConceptEvent } from "./events";
|
||||
import { MessageResponseDTO } from './dto/messageresponse.dto';
|
||||
import { PlayerResponseDTO } from './dto/playerresponse.dto';
|
||||
import type { ConceptEvent } from './events';
|
||||
|
||||
export class GameStartEvent implements ConceptEvent {
|
||||
type = "start";
|
||||
type = 'start';
|
||||
constructor(public currentPlayer: PlayerResponseDTO) {
|
||||
this.currentPlayer = new PlayerResponseDTO(currentPlayer);
|
||||
}
|
||||
}
|
||||
|
||||
export class GameDeleteEvent implements ConceptEvent {
|
||||
type = "delete";
|
||||
type = 'delete';
|
||||
}
|
||||
|
||||
export class GameJoinEvent implements ConceptEvent {
|
||||
type = "joingame";
|
||||
type = 'joingame';
|
||||
constructor(public player: PlayerResponseDTO) {
|
||||
this.player = new PlayerResponseDTO(player);
|
||||
}
|
||||
}
|
||||
|
||||
export class GameLeaveEvent implements ConceptEvent {
|
||||
type = "leavegame";
|
||||
type = 'leavegame';
|
||||
constructor(public player: PlayerResponseDTO) {
|
||||
this.player = new PlayerResponseDTO(player);
|
||||
}
|
||||
}
|
||||
|
||||
export class GameMessageEvent implements ConceptEvent {
|
||||
type = "message";
|
||||
type = 'message';
|
||||
constructor(public message: MessageResponseDTO) {
|
||||
this.message = new MessageResponseDTO(message);
|
||||
}
|
||||
}
|
||||
|
||||
export class GameMessageDeleteEvent implements ConceptEvent {
|
||||
type = "deleteMessage";
|
||||
type = 'deleteMessage';
|
||||
constructor(public messageId: number) {}
|
||||
}
|
||||
|
||||
export class GameEndTurnEvent implements ConceptEvent {
|
||||
type = "endTurn";
|
||||
type = 'endTurn';
|
||||
constructor(public currentPlayer: PlayerResponseDTO) {
|
||||
this.currentPlayer = new PlayerResponseDTO(currentPlayer);
|
||||
}
|
||||
|
||||
+8
-8
@@ -1,9 +1,9 @@
|
||||
import { GameResponseDTO } from "./dto/gameresponse.dto";
|
||||
import { PlayerResponseDTO } from "./dto/playerresponse.dto";
|
||||
import type { ConceptEvent } from "./events";
|
||||
import { GameResponseDTO } from './dto/gameresponse.dto';
|
||||
import { PlayerResponseDTO } from './dto/playerresponse.dto';
|
||||
import type { ConceptEvent } from './events';
|
||||
|
||||
export class LobbyCreateEvent implements ConceptEvent {
|
||||
type = "create";
|
||||
type = 'create';
|
||||
game: GameResponseDTO;
|
||||
constructor(game: GameResponseDTO) {
|
||||
this.game = new GameResponseDTO(game);
|
||||
@@ -11,19 +11,19 @@ export class LobbyCreateEvent implements ConceptEvent {
|
||||
}
|
||||
|
||||
export class LobbyStartEvent implements ConceptEvent {
|
||||
type = "start";
|
||||
type = 'start';
|
||||
constructor(public game: GameResponseDTO) {
|
||||
this.game = new GameResponseDTO(game);
|
||||
}
|
||||
}
|
||||
|
||||
export class LobbyDeleteEvent implements ConceptEvent {
|
||||
type = "delete";
|
||||
type = 'delete';
|
||||
constructor(public id: number) {}
|
||||
}
|
||||
|
||||
export class LobbyJoinEvent implements ConceptEvent {
|
||||
type = "joingame";
|
||||
type = 'joingame';
|
||||
constructor(
|
||||
public player: PlayerResponseDTO,
|
||||
public game: GameResponseDTO,
|
||||
@@ -34,7 +34,7 @@ export class LobbyJoinEvent implements ConceptEvent {
|
||||
}
|
||||
|
||||
export class LobbyLeaveEvent implements ConceptEvent {
|
||||
type = "leavegame";
|
||||
type = 'leavegame';
|
||||
gameId?: number;
|
||||
constructor(
|
||||
public player: PlayerResponseDTO,
|
||||
|
||||
+7
-7
@@ -1,31 +1,31 @@
|
||||
import { WordResponseDTO } from "./dto/wordresponse.dto";
|
||||
import type { ConceptEvent } from "./events";
|
||||
import { WordResponseDTO } from './dto/wordresponse.dto';
|
||||
import type { ConceptEvent } from './events';
|
||||
|
||||
export class WordCreateEvent implements ConceptEvent {
|
||||
type = "create";
|
||||
type = 'create';
|
||||
constructor(public word: WordResponseDTO) {
|
||||
this.word = new WordResponseDTO(word);
|
||||
}
|
||||
}
|
||||
|
||||
export class WordEditEvent implements ConceptEvent {
|
||||
type = "edit";
|
||||
type = 'edit';
|
||||
constructor(public word: WordResponseDTO) {
|
||||
this.word = new WordResponseDTO(word);
|
||||
}
|
||||
}
|
||||
|
||||
export class WordDeleteEvent implements ConceptEvent {
|
||||
type = "delete";
|
||||
type = 'delete';
|
||||
constructor(public id: number) {}
|
||||
}
|
||||
|
||||
export class WordEnableEvent implements ConceptEvent {
|
||||
type = "enable";
|
||||
type = 'enable';
|
||||
constructor(public id: number) {}
|
||||
}
|
||||
|
||||
export class WordDisableEvent implements ConceptEvent {
|
||||
type = "disable";
|
||||
type = 'disable';
|
||||
constructor(public id: number) {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user