Skip to content

Commit efb7f32

Browse files
committed
Set ball placement pos during penalty shootout
1 parent 55c3fa1 commit efb7f32

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

internal/app/statemachine/change_command.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,16 @@ func (s *StateMachine) processChangeNewCommand(newState *state.State, newCommand
7070
} else if *newState.GameState.Type == state.GameState_STOP {
7171
forTeam := *newState.ShootoutState.NextTeam
7272
newState.NextCommand = state.NewCommand(state.Command_PENALTY, forTeam)
73+
determiner := BallPlacementPosDeterminer{
74+
State: newState,
75+
Event: nil,
76+
Geometry: s.Geometry,
77+
OnPositiveHalf: map[state.Team]bool{
78+
state.Team_BLUE: *newState.TeamInfo(state.Team_BLUE).OnPositiveHalf,
79+
state.Team_YELLOW: *newState.TeamInfo(state.Team_YELLOW).OnPositiveHalf,
80+
},
81+
}
82+
newState.PlacementPos = determiner.Location()
7383
}
7484
}
7585

0 commit comments

Comments
 (0)