Refactor to merge Match.Status and Match.Winner fields into one.

This commit is contained in:
Patrick Fairbank
2020-03-29 00:04:15 -07:00
parent 14c9815980
commit df9c5dfbd9
20 changed files with 134 additions and 125 deletions

View File

@@ -586,7 +586,7 @@ func (arena *Arena) getNextMatch(excludeCurrent bool) (*model.Match, error) {
return nil, err
}
for _, match := range matches {
if match.Status != "complete" && !(excludeCurrent && match.Id == arena.CurrentMatch.Id) {
if !match.IsComplete() && !(excludeCurrent && match.Id == arena.CurrentMatch.Id) {
return &match, nil
}
}
@@ -882,7 +882,7 @@ func (arena *Arena) getEventStatusMessage() string {
// Only practice and qualification matches have a strict schedule.
return ""
}
if currentMatch.Status == "complete" {
if currentMatch.IsComplete() {
// This is a replay or otherwise unpredictable situation.
return ""
}