Refactor tournament progression methods into separate package.

This commit is contained in:
Patrick Fairbank
2017-08-27 18:20:44 -07:00
parent 53d34ae82a
commit f0fe7df2b3
16 changed files with 550 additions and 488 deletions

View File

@@ -8,6 +8,7 @@ package main
import (
"fmt"
"github.com/Team254/cheesy-arena/model"
"github.com/Team254/cheesy-arena/tournament"
"html/template"
"net/http"
"strconv"
@@ -188,14 +189,14 @@ func AllianceSelectionFinalizeHandler(w http.ResponseWriter, r *http.Request) {
}
// Generate the first round of elimination matches.
_, err = UpdateEliminationSchedule(db, startTime)
_, err = tournament.UpdateEliminationSchedule(db, startTime)
if err != nil {
handleWebErr(w, err)
return
}
// Reset yellow cards.
err = db.CalculateTeamCards("elimination")
err = tournament.CalculateTeamCards(db, "elimination")
if err != nil {
handleWebErr(w, err)
return