UNPKG

@battle-racing/br-common-lib

Version:

Common library for all Battle Racing Repositorios

26 lines (25 loc) 856 B
import type { Game, GameKartState } from '../Game'; import type { KartRankingItem } from '../KartRankingItem'; import type { KartProgress } from './KartProgress'; import { LapTime } from './LapTime'; export interface RaceKartState extends GameKartState { currentLap: number; } export interface RaceRakingItem extends KartRankingItem { progress: number; lapsCompleted: number; } export interface Race extends Game { type: 'Race'; laps: number; kartsState: Record<string, RaceKartState>; kartsProgress: Record<string, KartProgress[]>; gameRanking: RaceRakingItem[]; } export interface RankingWithKartsAndLapTimes extends RaceRakingItem { lapTimes: LapTime[]; fastestLap: LapTime | null; } export interface RaceWithDetailedRanking extends Omit<Race, 'kartsProgress'> { gameRanking: RankingWithKartsAndLapTimes[]; }