Skip to content

Commit b89e1e6

Browse files
committed
Allow to disable halftime recommendations
This is useful during development, when a match is automatically simulated indefinitely.
1 parent a1c2696 commit b89e1e6

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

internal/app/config/config.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ type Game struct {
6161
DistanceToBallInStop float64 `yaml:"distance-to-ball-in-stop"`
6262
AutoApproveGoals bool `yaml:"auto-approve-goals"`
6363
ContinueFromHalt bool `yaml:"continue-from-halt"`
64+
RecommendHalfTimes bool `yaml:"recommend-half-times"`
6465
ChallengeFlags int32 `yaml:"challenge-flags"`
6566
EmergencyStopGracePeriod time.Duration `yaml:"emergency-stop-grace-period"`
6667
PreparationTimeAfterHalt time.Duration `yaml:"preparation-time-after-halt"`
@@ -191,6 +192,8 @@ func DefaultControllerConfig() (c Controller) {
191192
c.Game.BallPlacementMinRobotDistance = 0.05
192193
c.Game.DistanceToBallInStop = 0.5
193194
c.Game.AutoApproveGoals = false
195+
c.Game.ContinueFromHalt = false
196+
c.Game.RecommendHalfTimes = true
194197
c.Game.ChallengeFlags = 3
195198
c.Game.EmergencyStopGracePeriod = 10 * time.Second
196199
c.Game.PreparationTimeAfterHalt = 10 * time.Second

internal/app/config/testdata/config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ game:
4444
distance-to-ball-in-stop: 0.5
4545
auto-approve-goals: false
4646
continue-from-halt: false
47+
recommend-half-times: true
4748
challenge-flags: 3
4849
emergency-stop-grace-period: 10s
4950
preparation-time-after-halt: 10s

internal/app/engine/process_continue_next_action.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ func (e *Engine) nextActions() (actions []*ContinueAction, hints []*ContinueHint
102102

103103
if *e.currentState.Command.Type == state.Command_STOP ||
104104
*e.currentState.Command.Type == state.Command_HALT {
105-
if e.currentState.StageTimeLeft.AsDuration() < 0 && *e.currentState.Stage != state.Referee_PENALTY_SHOOTOUT {
105+
if (e.gameConfig.RecommendHalfTimes || e.currentState.Stage.IsPausedStage()) &&
106+
e.currentState.StageTimeLeft.AsDuration() < 0 &&
107+
*e.currentState.Stage != state.Referee_PENALTY_SHOOTOUT {
106108
actions = append(actions, createContinueAction(
107109
ContinueAction_NEXT_STAGE,
108110
state.Team_UNKNOWN,

0 commit comments

Comments
 (0)