import { UserResponseDTO } from './userresponse.dto'; import { PlayerResponseDTO } from './playerresponse.dto'; import { ConceptInTurnResponseDTO } from './conceptinturnresponse.dto'; export class GameResponseDTO { constructor(partial: Partial) { this.id = partial.id; this.started = partial.started; this.ownerId = partial.ownerId; // this.owner = new UserResponseDTO(partial.owner); if (partial.players) { 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); } } id: number; ownerId: number; players: PlayerResponseDTO[] = []; currentPlayer?: PlayerResponseDTO; started: boolean; currentConcepts: ConceptInTurnResponseDTO[] = []; }