Skip to content

Commit

Permalink
Add suggest-end-of-match option
Browse files Browse the repository at this point in the history
Remove unused continue-from-halt option btw.
  • Loading branch information
g3force committed Feb 19, 2024
1 parent 2455d1e commit 00b3c0c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions internal/app/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ type Game struct {
BallPlacementMinRobotDistance float64 `yaml:"ball-placement-min-robot-distance"`
DistanceToBallInStop float64 `yaml:"distance-to-ball-in-stop"`
AutoApproveGoals bool `yaml:"auto-approve-goals"`
ContinueFromHalt bool `yaml:"continue-from-halt"`
SuggestEndOfMatch bool `yaml:"suggest-end-of-match"`
RecommendHalfTimes bool `yaml:"recommend-half-times"`
ChallengeFlags int32 `yaml:"challenge-flags"`
EmergencyStopGracePeriod time.Duration `yaml:"emergency-stop-grace-period"`
Expand Down Expand Up @@ -192,7 +192,7 @@ func DefaultControllerConfig() (c Controller) {
c.Game.BallPlacementMinRobotDistance = 0.05
c.Game.DistanceToBallInStop = 0.5
c.Game.AutoApproveGoals = false
c.Game.ContinueFromHalt = false
c.Game.SuggestEndOfMatch = true
c.Game.RecommendHalfTimes = true
c.Game.ChallengeFlags = 3
c.Game.EmergencyStopGracePeriod = 10 * time.Second
Expand Down
2 changes: 1 addition & 1 deletion internal/app/config/testdata/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ game:
ball-placement-min-robot-distance: 0.05
distance-to-ball-in-stop: 0.5
auto-approve-goals: false
continue-from-halt: false
suggest-end-of-match: true
recommend-half-times: true
challenge-flags: 3
emergency-stop-grace-period: 10s
Expand Down
2 changes: 1 addition & 1 deletion internal/app/engine/process_continue_next_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func (e *Engine) actionsToContinueFromStop() (actions []*ContinueAction, hints [
ContinueAction_READY_MANUAL,
))
}
if suggestEndOfMatch(e.currentState) {
if e.gameConfig.SuggestEndOfMatch && suggestEndOfMatch(e.currentState) {
actions = append(actions, createContinueAction(
ContinueAction_END_GAME,
state.Team_UNKNOWN,
Expand Down

0 comments on commit 00b3c0c

Please sign in to comment.