integration tests
Some checks failed
CI / lint-typecheck (pull_request) Failing after 4m51s
CI / tests (pull_request) Has been skipped
CI / contract-tests (pull_request) Has been skipped
CI / e2e-tests (pull_request) Has been skipped
CI / comment-pr (pull_request) Has been skipped
CI / commit-types (pull_request) Has been skipped

This commit is contained in:
2026-01-24 01:13:49 +01:00
parent 9bb6b228f1
commit 9ccecbf3bb
25 changed files with 895 additions and 2688 deletions

View File

@@ -51,6 +51,9 @@ export class RacingResultFactory {
? 2
: 3 + Math.floor(rng() * 6);
// Calculate points based on position
const points = this.calculatePoints(position);
results.push(
RaceResult.create({
id: seedId(`${race.id}:${driver.id}`, this.persistence),
@@ -60,6 +63,7 @@ export class RacingResultFactory {
startPosition: Math.max(1, startPosition),
fastestLap,
incidents,
points,
}),
);
}
@@ -96,4 +100,21 @@ export class RacingResultFactory {
return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
};
}
private calculatePoints(position: number): number {
// Standard F1-style points system
const pointsMap: Record<number, number> = {
1: 25,
2: 18,
3: 15,
4: 12,
5: 10,
6: 8,
7: 6,
8: 4,
9: 2,
10: 1,
};
return pointsMap[position] || 0;
}
}