Skip to content

Commit 0f75184

Browse files
committed
Implement checking for prepare kickoff positions
1 parent 3aa21c3 commit 0f75184

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

internal/app/engine/process_prepare.go

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,31 @@ func (e *Engine) processPrepare() {
1818
}
1919

2020
if *e.currentState.Command.Type == state.Command_KICKOFF {
21-
// TODO check if conditions met for kickoff
21+
// ball in center circle
22+
if e.gcState.TrackerStateGc.Ball.Pos.Length() > e.gameConfig.DistanceToBallInStop {
23+
return
24+
}
25+
26+
// bots on wrong side
27+
for _, robot := range e.gcState.TrackerStateGc.Robots {
28+
if *e.currentState.TeamState[robot.Id.Team.String()].OnPositiveHalf {
29+
if *robot.Pos.X < robotRadius {
30+
return
31+
}
32+
} else if *robot.Pos.X > -robotRadius {
33+
return
34+
}
35+
}
2236
}
2337

2438
if *e.currentState.Command.Type == state.Command_PENALTY {
2539
// TODO check if conditions met for penalty
40+
// keeper pos
41+
42+
// kicking team positions correct
43+
44+
// opponent team positions correct
45+
2646
}
2747

2848
e.Enqueue(&statemachine.Change{

0 commit comments

Comments
 (0)