@@ -18,7 +18,8 @@ const (
18
18
GameEventPlacementFailedByTeamInFavor GameEventType = "placementFailedByTeamInFavor"
19
19
GameEventPlacementFailedByOpponent GameEventType = "placementFailedByOpponent"
20
20
GameEventPlacementSucceeded GameEventType = "placementSucceeded"
21
- GameEventBotSubstitution GameEventType = "gameEventBotSubstitution"
21
+ GameEventBotSubstitution GameEventType = "botSubstitution"
22
+ GameEventTooManyRobots GameEventType = "tooManyRobots"
22
23
23
24
GameEventBallLeftFieldTouchLine GameEventType = "ballLeftFieldTouchLine"
24
25
GameEventBallLeftFieldGoalLine GameEventType = "ballLeftFieldGoalLine"
@@ -63,8 +64,8 @@ type GameEvent struct {
63
64
Details GameEventDetails `json:"details"`
64
65
}
65
66
66
- func (m GameEvent ) String () string {
67
- b , _ := json .Marshal (& m )
67
+ func (e GameEvent ) String () string {
68
+ b , _ := json .Marshal (& e )
68
69
return string (b )
69
70
}
70
71
@@ -106,6 +107,8 @@ func AllGameEvents() []GameEventType {
106
107
GameEventPlacementFailedByOpponent ,
107
108
GameEventPlacementSucceeded ,
108
109
GameEventPrepared ,
110
+ GameEventBotSubstitution ,
111
+ GameEventTooManyRobots ,
109
112
}
110
113
}
111
114
@@ -185,7 +188,8 @@ func (e GameEvent) IsSecondary() bool {
185
188
GameEventPlacementFailedByOpponent ,
186
189
GameEventPlacementSucceeded ,
187
190
GameEventPrepared ,
188
- GameEventBotSubstitution :
191
+ GameEventBotSubstitution ,
192
+ GameEventTooManyRobots :
189
193
return true
190
194
}
191
195
return false
@@ -290,8 +294,10 @@ func (e GameEvent) ToProto() *refproto.GameEvent {
290
294
protoEvent .Event = & refproto.GameEvent_Prepared_ {Prepared : e .Details .Prepared }
291
295
case GameEventBotSubstitution :
292
296
protoEvent .Event = & refproto.GameEvent_BotSubstitution_ {BotSubstitution : e .Details .BotSubstitution }
297
+ case GameEventTooManyRobots :
298
+ protoEvent .Event = & refproto.GameEvent_TooManyRobots_ {TooManyRobots : e .Details .TooManyRobots }
293
299
default :
294
- log .Printf ("Warn: Could not map game e %v" , e .Type )
300
+ log .Printf ("Warn: Could not map game event %v" , e .Type )
295
301
return nil
296
302
}
297
303
return protoEvent
@@ -336,6 +342,7 @@ type GameEventDetails struct {
336
342
PlacementSucceeded * refproto.GameEvent_PlacementSucceeded `json:"placementSucceeded,omitempty"`
337
343
Prepared * refproto.GameEvent_Prepared `json:"prepared,omitempty"`
338
344
BotSubstitution * refproto.GameEvent_BotSubstitution `json:"botSubstitution,omitempty"`
345
+ TooManyRobots * refproto.GameEvent_TooManyRobots `json:"tooManyRobots,omitempty"`
339
346
}
340
347
341
348
func (d GameEventDetails ) EventType () GameEventType {
@@ -450,6 +457,9 @@ func (d GameEventDetails) EventType() GameEventType {
450
457
if d .BotSubstitution != nil {
451
458
return GameEventBotSubstitution
452
459
}
460
+ if d .TooManyRobots != nil {
461
+ return GameEventTooManyRobots
462
+ }
453
463
return GameEventNone
454
464
}
455
465
@@ -649,6 +659,9 @@ func (d GameEventDetails) Description() string {
649
659
if d .BotSubstitution != nil {
650
660
return ""
651
661
}
662
+ if d .TooManyRobots != nil {
663
+ return ""
664
+ }
652
665
return ""
653
666
}
654
667
@@ -690,5 +703,6 @@ func NewGameEventDetails(event refproto.GameEvent) (d GameEventDetails) {
690
703
d .PlacementSucceeded = event .GetPlacementSucceeded ()
691
704
d .Prepared = event .GetPrepared ()
692
705
d .BotSubstitution = event .GetBotSubstitution ()
706
+ d .TooManyRobots = event .GetTooManyRobots ()
693
707
return
694
708
}
0 commit comments