Update game-specific models for 2018.

This commit is contained in:
Patrick Fairbank
2018-03-25 20:15:00 -07:00
parent cadfc5b095
commit e7cf700ced
32 changed files with 1134 additions and 976 deletions

View File

@@ -96,12 +96,12 @@ func (database *Database) TruncateMatchResults() error {
// Calculates and returns the summary fields used for ranking and display for the red alliance.
func (matchResult *MatchResult) RedScoreSummary() *game.ScoreSummary {
return matchResult.RedScore.Summarize(matchResult.BlueScore.Fouls, matchResult.MatchType)
return matchResult.RedScore.Summarize(matchResult.BlueScore.Fouls)
}
// Calculates and returns the summary fields used for ranking and display for the blue alliance.
func (matchResult *MatchResult) BlueScoreSummary() *game.ScoreSummary {
return matchResult.BlueScore.Summarize(matchResult.RedScore.Fouls, matchResult.MatchType)
return matchResult.BlueScore.Summarize(matchResult.RedScore.Fouls)
}
// Checks the score for disqualifications or a tie and adjusts it appropriately.

View File

@@ -25,7 +25,7 @@ func TestMatchResultCrud(t *testing.T) {
assert.Nil(t, err)
assert.Equal(t, matchResult, matchResult2)
matchResult.BlueScore.AutoMobility = 12
matchResult.BlueScore.AutoRuns = 12
db.SaveMatchResult(matchResult)
matchResult2, err = db.GetMatchResultForMatch(254)
assert.Nil(t, err)