Files
gridpilot.gg/apps/website/lib/view-models/LeagueScheduleViewModel.ts
2026-01-23 15:30:23 +01:00

23 lines
629 B
TypeScript

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