diff --git a/src/__tests__/tiebreak.test.ts b/src/__tests__/tiebreak.test.ts index 7dd9f48..1d58104 100644 --- a/src/__tests__/tiebreak.test.ts +++ b/src/__tests__/tiebreak.test.ts @@ -138,7 +138,10 @@ describe("TiebreakCalculation", () => { }) it("should use virtual opponents for unplayed games", () => { - const rounds = new Results(TournamentType.SWISS, [round(["A:B 1:0"]), round(["A:B 1:0 forfeit"])]) + const rounds = new Results(TournamentType.SWISS, [ + round(["A:B 1:0"]), + round(["A:B 1:0 forfeit"]), + ]) const tiebreak = new Tiebreaker(rounds, UnplayedRoundsAdjustment.FIDE_2009) // A's first opponent contributes (0 + 0.5) and the second (1 + 0) diff --git a/src/results.ts b/src/results.ts index b8f916a..5dacd81 100644 --- a/src/results.ts +++ b/src/results.ts @@ -38,7 +38,7 @@ export type Pairing = { export enum TournamentType { // TODO: Add support for round robin tournaments (where no unplayed games adjustments are made). - SWISS = "SWISS" + SWISS = "SWISS", } /** @@ -47,7 +47,10 @@ export enum TournamentType { export class Results { private pairings: Map> = new Map() - constructor(public readonly tournamentType: TournamentType, results: RoundResults[]) { + constructor( + public readonly tournamentType: TournamentType, + results: RoundResults[], + ) { for (const [roundIndex, roundResults] of results.entries()) { for (const pairing of roundResults.pairings) { this.addToMap(pairing.white, roundIndex + 1, {