Skip to content

Add techfall detection #33

@JvmName

Description

@JvmName

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});
+   }
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions