Skip to content

Commit 5294213

Browse files
committed
Add a hint that reports the timeout time left
1 parent 3a6f3f7 commit 5294213

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/app/engine/process_continue_next_action.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"github.com/RoboCup-SSL/ssl-game-controller/internal/app/state"
77
"log"
88
"math"
9+
"time"
910
)
1011

1112
func (e *Engine) nextActions() (actions []*ContinueAction, hints []*ContinueHint) {
@@ -46,6 +47,10 @@ func (e *Engine) nextActions() (actions []*ContinueAction, hints []*ContinueHint
4647
}
4748

4849
if *e.currentState.Command.Type == state.Command_TIMEOUT {
50+
timeLeft := e.currentState.TeamInfo(*e.currentState.Command.ForTeam).TimeoutTimeLeft.AsDuration().Truncate(time.Second)
51+
message := fmt.Sprintf("Timeout time left: %s", timeLeft)
52+
hints = append(hints, &ContinueHint{Message: &message})
53+
4954
actions = append(actions, createContinueAction(
5055
ContinueAction_TIMEOUT_STOP,
5156
*e.currentState.Command.ForTeam,

0 commit comments

Comments
 (0)