import { ViewModel } from "../contracts/view-models/ViewModel"; import type { LeagueScheduleViewData } from "../view-data/LeagueScheduleViewData"; import type { LeagueScheduleRaceViewModel } from "./LeagueScheduleRaceViewModel"; export class LeagueScheduleViewModel extends ViewModel { readonly races: LeagueScheduleRaceViewModel[]; constructor(data: LeagueScheduleViewData) { super(); this.races = data.races; } get raceCount(): number { return this.races.length; } get hasRaces(): boolean { return this.raceCount > 0; } }