Newer
Older
import { ObjectivePointEntity } from './game.entity';
import { CenterJSON } from '../shared/custom-validation';
import { FactionDTO } from '../faction/faction.dto';
import { CenterDTO, NodeSettingsDTO } from './game.json.dto';
name: string;
@IsNotEmpty()
@Length(1, 255)
desc: string;
@ValidateNested()
@Type(() => CenterDTO)
center: CenterDTO;
@Allow()
@ValidateNested()
@Type(() => NodeSettingsDTO)
nodesettings?: NodeSettingsDTO;
@IsDateString()
@IsNotEmpty()
startdate: string;
@IsDateString()
@IsNotEmpty()
enddate: string;
@ValidateNested()
@Type(() => FactionDTO)
@ValidateNested()
@Type(() => FlagboxDTO)
export class newGameDTO {
@IsString()
@IsNotEmpty()
@Length(3, 30)
name: string;
@IsString()
@IsNotEmpty()
@Length(1, 255)
desc: string;
@IsNotEmpty()
center: JSON;
@IsDateString()
@IsNotEmpty()
startdate: string;
@IsDateString()
@IsNotEmpty()
enddate: string;
}
export class GameStateDTO {
@IsUUID('4')
id: string;
@IsIn(['CREATED', 'STARTED', 'PAUSED', 'ENDED'])
state: string;
}
@IsOptional()
@IsUUID('4')
objectivePointId: string;
@IsString()
@IsNotEmpty()
@Length(7)
objectivePointDescription: string;
@IsNumber()
objectivePointMultiplier: number;
}
export class FlagboxEventDTO {
@IsString()
@IsNotEmpty()
@Length(7)
@IsNumber()
@Min(0)
@Max(3)
owner: number; // owner = 0, => first entry in faction db, owner = 1, => second entry etc
@IsNumber()
@Min(0)
@Max(3)
action: number; // 0=no capture ongoing, 1=captured, 2=capture ongoing
@IsNumber()
@Min(0)
@Max(3)
capture: number; // which faction is capturing, same logic as in owner with numbers
oP_HistoryTimestamp?: string;
objective_point?: ObjectivePointEntity;