Skip to content

Commit

Permalink
Merge pull request #27 from giaunguyen2176/fix/calculate_bye_score
Browse files Browse the repository at this point in the history
Calculate bye score
  • Loading branch information
slashinfty authored Jun 10, 2024
2 parents bed5cf4 + 34539c9 commit cd90f00
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/Tournament.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,9 @@ export class Tournament {
return matchA.round - matchB.round;
});
player.player.matches.filter(match => this.matches.find(m => m.id === match.id && m.active === false)).forEach(match => {
player.gamePoints += (this.scoring.win * match.win) + (this.scoring.loss * match.loss) + (this.scoring.draw * match.draw);
player.gamePoints += ((match.bye ? this.scoring.bye : this.scoring.win) * match.win) + (this.scoring.loss * match.loss) + (this.scoring.draw * match.draw);
player.games += match.win + match.loss + match.draw;
player.matchPoints += match.win > match.loss ? this.scoring.win : match.loss > match.win ? this.scoring.loss : this.scoring.draw;
player.matchPoints += match.bye ? this.scoring.bye : match.win > match.loss ? this.scoring.win : match.loss > match.win ? this.scoring.loss : this.scoring.draw;
player.tiebreaks.cumulative += player.matchPoints;
player.matches++;
});
Expand Down

0 comments on commit cd90f00

Please sign in to comment.