slashinfty / tournament-organizer

JavaScript library for running tournaments
https://slashinfty.github.io/tournament-organizer/
MIT License
51 stars 18 forks source link

Calculate bye score #27

Closed giaunguyen2176 closed 4 months ago

giaunguyen2176 commented 4 months ago

Currently, score formula does not seems to take into consideration of bye match/games. But the scoring configuration object has allowed to configure score for each bye match/game. So adjust the formula to add points in such cases.

slashinfty commented 4 months ago

I'd prefer the following so players receive the correct amount of game points for a bye:

player.gamePoints += ((match.bye ? this.scoring.bye : this.scoring.win) * match.win) + (this.scoring.loss * match.loss) + (this.scoring.draw * match.draw);
giaunguyen2176 commented 4 months ago

When match.bye = true, match.win = 0, ((match.bye ? this.scoring.bye : this.scoring.win) * match.win) will be 0. I don't think that's expected.

slashinfty commented 4 months ago

Why would match.win be 0? See: here, here, and here.

giaunguyen2176 commented 4 months ago

@slashinfty you're right. I've updated the calculation. Take a look again please.

slashinfty commented 4 months ago

I will get v3.6.3 out later today with this included