import { computeGame } from "./game"; import { computeStandings } from "./standings"; import type { EventResult, ScoringInput } from "./types"; export { computeCell } from "./cell"; export { computeGame } from "./game"; export { round2 } from "./round"; export { computeStandings } from "./standings"; export type * from "./types"; /** The one entry point: admin view, scoreboard API and judge view all call this. */ export function computeEvent(input: ScoringInput): EventResult { const gameResults = input.games.map((game) => computeGame(game, input.teams, input.criteria, input.judges, input.scores), ); return { games: Object.fromEntries(gameResults.map((result) => [result.gameId, result])), standings: computeStandings(input.teams, gameResults, input.adjustments), }; }