Add qualified efficiency leaderboard rankings

This commit is contained in:
2026-10-01 12:16:27 -04:00
parent c7d71c63ba
commit 47ebe83106
9 changed files with 385 additions and 25 deletions
+7 -3
View File
@@ -1,4 +1,6 @@
export const leaderboardMetrics = [
import { efficiencyMetrics, type EfficiencyMetric } from './leaderboard-efficiency.js';
export const playerStatMetrics = [
{ key: 'highestRound', label: 'Highest round' },
{ key: 'kills', label: 'Total kills' },
{ key: 'roundsSurvived', label: 'Total rounds' },
@@ -11,9 +13,11 @@ export const leaderboardMetrics = [
{ key: 'bestScore', label: 'Highest reported score' }
] as const;
export const leaderboardMetrics = [...playerStatMetrics, ...efficiencyMetrics] as const;
export type LeaderboardMetric = typeof leaderboardMetrics[number]['key'];
export type PlayerStatMetric = typeof playerStatMetrics[number]['key'];
export type PlayerStats = Record<LeaderboardMetric, number>;
export type PlayerStats = Record<PlayerStatMetric, number>;
export type PersonalBestMetric = 'highestRound' | 'bestKills' | 'bestScore';
export interface RecordEvidence {
matchId: number;
@@ -71,7 +75,7 @@ export function playerProfileHref(guid: string): string {
return `/leaderboard/players/${encodeURIComponent(guid)}`;
}
export interface LeaderboardEntry {
export interface LeaderboardEntry extends Record<EfficiencyMetric, number | null> {
rank: number;
guid: string;
name: string;