@@ -28,29 +28,7 @@ func (c *BallPlacementCoordinator) process() {
28
28
29
29
remainingDistance := c .remainingPlacementDistance ()
30
30
31
- if e .ballSteady () && e .teamInFavorKeepsSufficientDistance () &&
32
- float64 (remainingDistance ) <= e .gameConfig .BallPlacementTolerance {
33
- // if opponent does not yet keep sufficient distance, that's not the placing teams fold,
34
- // so just wait a bit more
35
- if e .opponentTeamKeepsSufficientDistance () {
36
- duration := float32 (e .timeProvider ().Sub (* c .ballPlacementStartTime ).Seconds ())
37
- var distance * float32
38
- if c .ballPlacementStartPos != nil && e .gcState .TrackerStateGc .Ball .Pos != nil {
39
- distance = new (float32 )
40
- * distance = float32 (c .ballPlacementStartPos .DistanceTo (e .gcState .TrackerStateGc .Ball .Pos .ToVector2 ()))
41
- }
42
- e .Enqueue (createGameEventChange (state .GameEvent_PLACEMENT_SUCCEEDED , state.GameEvent {
43
- Event : & state.GameEvent_PlacementSucceeded_ {
44
- PlacementSucceeded : & state.GameEvent_PlacementSucceeded {
45
- ByTeam : e .currentState .Command .ForTeam ,
46
- TimeTaken : & duration ,
47
- Precision : & remainingDistance ,
48
- Distance : distance ,
49
- },
50
- },
51
- }))
52
- }
53
- } else if goDur (e .currentState .CurrentActionTimeRemaining ) <= 0 {
31
+ if goDur (e .currentState .CurrentActionTimeRemaining ) <= 0 {
54
32
e .Enqueue (createGameEventChange (state .GameEvent_PLACEMENT_FAILED , state.GameEvent {
55
33
Event : & state.GameEvent_PlacementFailed_ {
56
34
PlacementFailed : & state.GameEvent_PlacementFailed {
@@ -70,32 +48,3 @@ func (c *BallPlacementCoordinator) remainingPlacementDistance() float32 {
70
48
ballPos := c .gcEngine .gcState .TrackerStateGc .Ball .Pos .ToVector2 ()
71
49
return float32 (placementPos .DistanceTo (ballPos ))
72
50
}
73
-
74
- func (e * Engine ) teamInFavorKeepsSufficientDistance () bool {
75
- radius := e .gameConfig .BallPlacementMinRobotDistance + robotRadius + distanceThreshold
76
- if e .currentState .NextCommand != nil && e .currentState .NextCommand .ForTeam == nil {
77
- radius = e .gameConfig .DistanceToBallInStop + robotRadius + distanceThreshold
78
- }
79
-
80
- var robots []* Robot
81
- for _ , robot := range e .gcState .TrackerStateGc .Robots {
82
- if * robot .Id .Team == * e .currentState .Command .ForTeam {
83
- robots = append (robots , robot )
84
- }
85
- }
86
-
87
- return ! e .robotsInsideRadius (robots , e .gcState .TrackerStateGc .Ball .Pos .ToVector2 (), radius )
88
- }
89
-
90
- func (e * Engine ) opponentTeamKeepsSufficientDistance () bool {
91
- radius := e .gameConfig .DistanceToBallInStop + robotRadius + distanceThreshold
92
-
93
- var robots []* Robot
94
- for _ , robot := range e .gcState .TrackerStateGc .Robots {
95
- if * robot .Id .Team != * e .currentState .Command .ForTeam {
96
- robots = append (robots , robot )
97
- }
98
- }
99
-
100
- return ! e .robotsInsideRadius (robots , e .gcState .TrackerStateGc .Ball .Pos .ToVector2 (), radius )
101
- }
0 commit comments