37 lines
915 B
TypeScript
37 lines
915 B
TypeScript
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<GameResponseDTO>) {
|
|
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[];
|
|
}
|