-
Couldn't load subscription status.
- Fork 61
Open
Description
The viewer should not have much logic. It should just display data created by the manager.
So round-robin ranking calculation should go in the manager's get module. Just as the standings.
brackets-viewer.js/src/helpers.ts
Lines 180 to 193 in 5bdcdaa
| export function getRanking(matches: Match[], formula?: RankingFormula): Ranking { | |
| formula = formula || ( | |
| (item: RankingItem): number => 3 * item.wins + 1 * item.draws + 0 * item.losses | |
| ); | |
| const rankingMap: RankingMap = {}; | |
| for (const match of matches) { | |
| processParticipant(rankingMap, formula, match.opponent1, match.opponent2); | |
| processParticipant(rankingMap, formula, match.opponent2, match.opponent1); | |
| } | |
| return createRanking(rankingMap); | |
| } |
Related: Drarig29/brackets-manager.js#69 Drarig29/brackets-manager.js#72
AnthonyCouval
Metadata
Metadata
Assignees
Labels
No labels