@battle-racing/br-common-lib
Version:
Common library for all Battle Racing Repositorios
32 lines (26 loc) • 888 B
text/typescript
import { Kart } from '../../kart';
import type { Game, GameKartState } from '../Game';
import type { KartRankingItem } from '../KartRankingItem';
import type { KartProgress } from './KartProgress';
import { KartLapTimes, 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[];
}