mirror of
https://github.com/Team254/cheesy-arena-lite.git
synced 2026-03-09 13:46:44 -04:00
Simpify scoring model and fix RungIsLevel bonus logic.
This commit is contained in:
@@ -95,13 +95,13 @@ 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)
|
||||
func (matchResult *MatchResult) RedScoreSummary(teleopStarted bool) *game.ScoreSummary {
|
||||
return matchResult.RedScore.Summarize(matchResult.BlueScore.Fouls, teleopStarted)
|
||||
}
|
||||
|
||||
// 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)
|
||||
func (matchResult *MatchResult) BlueScoreSummary(teleopStarted bool) *game.ScoreSummary {
|
||||
return matchResult.BlueScore.Summarize(matchResult.RedScore.Fouls, teleopStarted)
|
||||
}
|
||||
|
||||
// Checks the score for disqualifications or a tie and adjusts it appropriately.
|
||||
|
||||
@@ -26,7 +26,7 @@ func TestMatchResultCrud(t *testing.T) {
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, matchResult, matchResult2)
|
||||
|
||||
matchResult.BlueScore.EndgameStatuses = [3]game.EndgameStatus{game.Hang, game.None, game.Park}
|
||||
matchResult.BlueScore.EndgameStatuses = [3]game.EndgameStatus{game.EndgameHang, game.EndgameNone, game.EndgamePark}
|
||||
db.SaveMatchResult(matchResult)
|
||||
matchResult2, err = db.GetMatchResultForMatch(254)
|
||||
assert.Nil(t, err)
|
||||
|
||||
Reference in New Issue
Block a user