Auto-end round when competitor reaches point threshold.
Changes:
- After each vote change, recalculate points for both competitors
- If either >=
round.point_threshold, auto-end round
- Set
end_method='techfall' and winner_id
Round model:
async updatePoints() {
this.red_points = calculatePoints(redVotes, ...);
this.blue_points = calculatePoints(blueVotes, ...);
+
+ if (this.red_points >= this.point_threshold) {
+ await this.end({method: 'techfall', winner: red});
+ } else if (this.blue_points >= this.point_threshold) {
+ await this.end({method: 'techfall', winner: blue});
+ }
}
Auto-end round when competitor reaches point threshold.
Changes:
round.point_threshold, auto-end roundend_method='techfall'andwinner_idRound model:
async updatePoints() { this.red_points = calculatePoints(redVotes, ...); this.blue_points = calculatePoints(blueVotes, ...); + + if (this.red_points >= this.point_threshold) { + await this.end({method: 'techfall', winner: red}); + } else if (this.blue_points >= this.point_threshold) { + await this.end({method: 'techfall', winner: blue}); + } }