Files
gridpilot.gg/adapters/racing/services/InMemoryDriverStatsService.ts
2025-12-30 00:15:35 +01:00

17 lines
698 B
TypeScript

import type { IDriverStatsService, DriverStats } from '@core/racing/domain/services/IDriverStatsService';
import type { Logger } from '@core/shared/application';
import { DriverStatsStore } from './DriverStatsStore';
export class InMemoryDriverStatsService implements IDriverStatsService {
private store: DriverStatsStore;
constructor(private readonly logger: Logger) {
this.logger.info('InMemoryDriverStatsService initialized.');
this.store = DriverStatsStore.getInstance();
}
getDriverStats(driverId: string): DriverStats | null {
this.logger.debug(`[InMemoryDriverStatsService] Getting stats for driver: ${driverId}`);
return this.store.getDriverStats(driverId);
}
}