File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -18,11 +18,31 @@ func (e *Engine) processPrepare() {
18
18
}
19
19
20
20
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
+ }
22
36
}
23
37
24
38
if * e .currentState .Command .Type == state .Command_PENALTY {
25
39
// TODO check if conditions met for penalty
40
+ // keeper pos
41
+
42
+ // kicking team positions correct
43
+
44
+ // opponent team positions correct
45
+
26
46
}
27
47
28
48
e .Enqueue (& statemachine.Change {
You can’t perform that action at this time.
0 commit comments