@@ -18,7 +18,8 @@ const (
1818 GameEventPlacementFailedByTeamInFavor GameEventType = "placementFailedByTeamInFavor"
1919 GameEventPlacementFailedByOpponent GameEventType = "placementFailedByOpponent"
2020 GameEventPlacementSucceeded GameEventType = "placementSucceeded"
21- GameEventBotSubstitution GameEventType = "gameEventBotSubstitution"
21+ GameEventBotSubstitution GameEventType = "botSubstitution"
22+ GameEventTooManyRobots GameEventType = "tooManyRobots"
2223
2324 GameEventBallLeftFieldTouchLine GameEventType = "ballLeftFieldTouchLine"
2425 GameEventBallLeftFieldGoalLine GameEventType = "ballLeftFieldGoalLine"
@@ -63,8 +64,8 @@ type GameEvent struct {
6364 Details GameEventDetails `json:"details"`
6465}
6566
66- func (m GameEvent ) String () string {
67- b , _ := json .Marshal (& m )
67+ func (e GameEvent ) String () string {
68+ b , _ := json .Marshal (& e )
6869 return string (b )
6970}
7071
@@ -106,6 +107,8 @@ func AllGameEvents() []GameEventType {
106107 GameEventPlacementFailedByOpponent ,
107108 GameEventPlacementSucceeded ,
108109 GameEventPrepared ,
110+ GameEventBotSubstitution ,
111+ GameEventTooManyRobots ,
109112 }
110113}
111114
@@ -185,7 +188,8 @@ func (e GameEvent) IsSecondary() bool {
185188 GameEventPlacementFailedByOpponent ,
186189 GameEventPlacementSucceeded ,
187190 GameEventPrepared ,
188- GameEventBotSubstitution :
191+ GameEventBotSubstitution ,
192+ GameEventTooManyRobots :
189193 return true
190194 }
191195 return false
@@ -290,8 +294,10 @@ func (e GameEvent) ToProto() *refproto.GameEvent {
290294 protoEvent .Event = & refproto.GameEvent_Prepared_ {Prepared : e .Details .Prepared }
291295 case GameEventBotSubstitution :
292296 protoEvent .Event = & refproto.GameEvent_BotSubstitution_ {BotSubstitution : e .Details .BotSubstitution }
297+ case GameEventTooManyRobots :
298+ protoEvent .Event = & refproto.GameEvent_TooManyRobots_ {TooManyRobots : e .Details .TooManyRobots }
293299 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 )
295301 return nil
296302 }
297303 return protoEvent
@@ -336,6 +342,7 @@ type GameEventDetails struct {
336342 PlacementSucceeded * refproto.GameEvent_PlacementSucceeded `json:"placementSucceeded,omitempty"`
337343 Prepared * refproto.GameEvent_Prepared `json:"prepared,omitempty"`
338344 BotSubstitution * refproto.GameEvent_BotSubstitution `json:"botSubstitution,omitempty"`
345+ TooManyRobots * refproto.GameEvent_TooManyRobots `json:"tooManyRobots,omitempty"`
339346}
340347
341348func (d GameEventDetails ) EventType () GameEventType {
@@ -450,6 +457,9 @@ func (d GameEventDetails) EventType() GameEventType {
450457 if d .BotSubstitution != nil {
451458 return GameEventBotSubstitution
452459 }
460+ if d .TooManyRobots != nil {
461+ return GameEventTooManyRobots
462+ }
453463 return GameEventNone
454464}
455465
@@ -649,6 +659,9 @@ func (d GameEventDetails) Description() string {
649659 if d .BotSubstitution != nil {
650660 return ""
651661 }
662+ if d .TooManyRobots != nil {
663+ return ""
664+ }
652665 return ""
653666}
654667
@@ -690,5 +703,6 @@ func NewGameEventDetails(event refproto.GameEvent) (d GameEventDetails) {
690703 d .PlacementSucceeded = event .GetPlacementSucceeded ()
691704 d .Prepared = event .GetPrepared ()
692705 d .BotSubstitution = event .GetBotSubstitution ()
706+ d .TooManyRobots = event .GetTooManyRobots ()
693707 return
694708}
0 commit comments