@@ -265,84 +265,123 @@ func (e GameEvent) IsContinueGame() bool {
265265// ToProto converts the internal game event into a protobuf game event
266266func (e GameEvent ) ToProto () * refproto.GameEvent {
267267 protoEvent := new (refproto.GameEvent )
268+ protoEvent .Type = new (refproto.GameEventType )
268269 switch e .Type {
269270 case GameEventNone :
270271 return nil
271272 case GameEventBallLeftFieldGoalLine :
273+ * protoEvent .Type = refproto .GameEventType_BALL_LEFT_FIELD_GOAL_LINE
272274 protoEvent .Event = & refproto.GameEvent_BallLeftFieldGoalLine {BallLeftFieldGoalLine : e .Details .BallLeftFieldGoalLine }
273275 case GameEventBallLeftFieldTouchLine :
276+ * protoEvent .Type = refproto .GameEventType_BALL_LEFT_FIELD_TOUCH_LINE
274277 protoEvent .Event = & refproto.GameEvent_BallLeftFieldTouchLine {BallLeftFieldTouchLine : e .Details .BallLeftFieldTouchLine }
275278 case GameEventAimlessKick :
279+ * protoEvent .Type = refproto .GameEventType_AIMLESS_KICK
276280 protoEvent .Event = & refproto.GameEvent_AimlessKick_ {AimlessKick : e .Details .AimlessKick }
277281 case GameEventGoal :
282+ * protoEvent .Type = refproto .GameEventType_GOAL
278283 protoEvent .Event = & refproto.GameEvent_Goal_ {Goal : e .Details .Goal }
279284 case GameEventPossibleGoal :
285+ * protoEvent .Type = refproto .GameEventType_POSSIBLE_GOAL
280286 protoEvent .Event = & refproto.GameEvent_PossibleGoal {PossibleGoal : e .Details .PossibleGoal }
281287 case GameEventIndirectGoal :
288+ * protoEvent .Type = refproto .GameEventType_INDIRECT_GOAL
282289 protoEvent .Event = & refproto.GameEvent_IndirectGoal_ {IndirectGoal : e .Details .IndirectGoal }
283290 case GameEventChippedGoal :
291+ * protoEvent .Type = refproto .GameEventType_CHIPPED_GOAL
284292 protoEvent .Event = & refproto.GameEvent_ChippedGoal_ {ChippedGoal : e .Details .ChippedGoal }
285293 case GameEventBotTooFastInStop :
294+ * protoEvent .Type = refproto .GameEventType_BOT_TOO_FAST_IN_STOP
286295 protoEvent .Event = & refproto.GameEvent_BotTooFastInStop_ {BotTooFastInStop : e .Details .BotTooFastInStop }
287296 case GameEventBotTippedOver :
297+ * protoEvent .Type = refproto .GameEventType_BOT_TIPPED_OVER
288298 protoEvent .Event = & refproto.GameEvent_BotTippedOver_ {BotTippedOver : e .Details .BotTippedOver }
289299 case GameEventBotInterferedPlacement :
300+ * protoEvent .Type = refproto .GameEventType_BOT_INTERFERED_PLACEMENT
290301 protoEvent .Event = & refproto.GameEvent_BotInterferedPlacement_ {BotInterferedPlacement : e .Details .BotInterferedPlacement }
291302 case GameEventBotCrashDrawn :
303+ * protoEvent .Type = refproto .GameEventType_BOT_CRASH_DRAWN
292304 protoEvent .Event = & refproto.GameEvent_BotCrashDrawn_ {BotCrashDrawn : e .Details .BotCrashDrawn }
293305 case GameEventBotKickedBallTooFast :
306+ * protoEvent .Type = refproto .GameEventType_BOT_KICKED_BALL_TOO_FAST
294307 protoEvent .Event = & refproto.GameEvent_BotKickedBallTooFast_ {BotKickedBallTooFast : e .Details .BotKickedBallTooFast }
295308 case GameEventBotDribbledBallTooFar :
309+ * protoEvent .Type = refproto .GameEventType_BOT_DRIBBLED_BALL_TOO_FAR
296310 protoEvent .Event = & refproto.GameEvent_BotDribbledBallTooFar_ {BotDribbledBallTooFar : e .Details .BotDribbledBallTooFar }
297311 case GameEventBotCrashUnique :
312+ * protoEvent .Type = refproto .GameEventType_BOT_CRASH_UNIQUE
298313 protoEvent .Event = & refproto.GameEvent_BotCrashUnique_ {BotCrashUnique : e .Details .BotCrashUnique }
299314 case GameEventBotCrashUniqueSkipped :
315+ * protoEvent .Type = refproto .GameEventType_BOT_CRASH_UNIQUE_SKIPPED
300316 protoEvent .Event = & refproto.GameEvent_BotCrashUniqueSkipped {BotCrashUniqueSkipped : e .Details .BotCrashUniqueSkipped }
301317 case GameEventBotPushedBot :
318+ * protoEvent .Type = refproto .GameEventType_BOT_PUSHED_BOT
302319 protoEvent .Event = & refproto.GameEvent_BotPushedBot_ {BotPushedBot : e .Details .BotPushedBot }
303320 case GameEventBotPushedBotSkipped :
321+ * protoEvent .Type = refproto .GameEventType_BOT_PUSHED_BOT_SKIPPED
304322 protoEvent .Event = & refproto.GameEvent_BotPushedBotSkipped {BotPushedBotSkipped : e .Details .BotPushedBotSkipped }
305323 case GameEventBotHeldBallDeliberately :
324+ * protoEvent .Type = refproto .GameEventType_BOT_HELD_BALL_DELIBERATELY
306325 protoEvent .Event = & refproto.GameEvent_BotHeldBallDeliberately_ {BotHeldBallDeliberately : e .Details .BotHeldBallDeliberately }
307326 case GameEventAttackerDoubleTouchedBall :
327+ * protoEvent .Type = refproto .GameEventType_ATTACKER_DOUBLE_TOUCHED_BALL
308328 protoEvent .Event = & refproto.GameEvent_AttackerDoubleTouchedBall_ {AttackerDoubleTouchedBall : e .Details .AttackerDoubleTouchedBall }
309329 case GameEventAttackerTooCloseToDefenseArea :
330+ * protoEvent .Type = refproto .GameEventType_ATTACKER_TOO_CLOSE_TO_DEFENSE_AREA
310331 protoEvent .Event = & refproto.GameEvent_AttackerTooCloseToDefenseArea_ {AttackerTooCloseToDefenseArea : e .Details .AttackerTooCloseToDefenseArea }
311332 case GameEventAttackerInDefenseArea :
333+ * protoEvent .Type = refproto .GameEventType_ATTACKER_IN_DEFENSE_AREA
312334 protoEvent .Event = & refproto.GameEvent_AttackerInDefenseArea_ {AttackerInDefenseArea : e .Details .AttackerInDefenseArea }
313335 case GameEventAttackerTouchedKeeper :
336+ * protoEvent .Type = refproto .GameEventType_ATTACKER_TOUCHED_KEEPER
314337 protoEvent .Event = & refproto.GameEvent_AttackerTouchedKeeper_ {AttackerTouchedKeeper : e .Details .AttackerTouchedKeeper }
315338 case GameEventDefenderTooCloseToKickPoint :
339+ * protoEvent .Type = refproto .GameEventType_DEFENDER_TOO_CLOSE_TO_KICK_POINT
316340 protoEvent .Event = & refproto.GameEvent_DefenderTooCloseToKickPoint_ {DefenderTooCloseToKickPoint : e .Details .DefenderTooCloseToKickPoint }
317341 case GameEventDefenderInDefenseAreaPartially :
342+ * protoEvent .Type = refproto .GameEventType_DEFENDER_IN_DEFENSE_AREA_PARTIALLY
318343 protoEvent .Event = & refproto.GameEvent_DefenderInDefenseAreaPartially_ {DefenderInDefenseAreaPartially : e .Details .DefenderInDefenseAreaPartially }
319344 case GameEventDefenderInDefenseArea :
345+ * protoEvent .Type = refproto .GameEventType_DEFENDER_IN_DEFENSE_AREA
320346 protoEvent .Event = & refproto.GameEvent_DefenderInDefenseArea_ {DefenderInDefenseArea : e .Details .DefenderInDefenseArea }
321347 case GameEventKeeperHeldBall :
348+ * protoEvent .Type = refproto .GameEventType_KEEPER_HELD_BALL
322349 protoEvent .Event = & refproto.GameEvent_KeeperHeldBall_ {KeeperHeldBall : e .Details .KeeperHeldBall }
323350 case GameEventUnsportingBehaviorMinor :
351+ * protoEvent .Type = refproto .GameEventType_UNSPORTING_BEHAVIOR_MINOR
324352 protoEvent .Event = & refproto.GameEvent_UnsportingBehaviorMinor_ {UnsportingBehaviorMinor : e .Details .UnsportingBehaviorMinor }
325353 case GameEventUnsportingBehaviorMajor :
354+ * protoEvent .Type = refproto .GameEventType_UNSPORTING_BEHAVIOR_MAJOR
326355 protoEvent .Event = & refproto.GameEvent_UnsportingBehaviorMajor_ {UnsportingBehaviorMajor : e .Details .UnsportingBehaviorMajor }
327356 case GameEventMultipleCards :
357+ * protoEvent .Type = refproto .GameEventType_MULTIPLE_CARDS
328358 protoEvent .Event = & refproto.GameEvent_MultipleCards_ {MultipleCards : e .Details .MultipleCards }
329359 case GameEventMultipleFouls :
360+ * protoEvent .Type = refproto .GameEventType_MULTIPLE_FOULS
330361 protoEvent .Event = & refproto.GameEvent_MultipleFouls_ {MultipleFouls : e .Details .MultipleFouls }
331362 case GameEventMultiplePlacementFailures :
363+ * protoEvent .Type = refproto .GameEventType_MULTIPLE_PLACEMENT_FAILURES
332364 protoEvent .Event = & refproto.GameEvent_MultiplePlacementFailures_ {MultiplePlacementFailures : e .Details .MultiplePlacementFailures }
333365 case GameEventKickTimeout :
366+ * protoEvent .Type = refproto .GameEventType_KICK_TIMEOUT
334367 protoEvent .Event = & refproto.GameEvent_KickTimeout_ {KickTimeout : e .Details .KickTimeout }
335368 case GameEventNoProgressInGame :
369+ * protoEvent .Type = refproto .GameEventType_NO_PROGRESS_IN_GAME
336370 protoEvent .Event = & refproto.GameEvent_NoProgressInGame_ {NoProgressInGame : e .Details .NoProgressInGame }
337371 case GameEventPlacementFailed :
372+ * protoEvent .Type = refproto .GameEventType_PLACEMENT_FAILED
338373 protoEvent .Event = & refproto.GameEvent_PlacementFailed_ {PlacementFailed : e .Details .PlacementFailed }
339374 case GameEventPlacementSucceeded :
375+ * protoEvent .Type = refproto .GameEventType_PLACEMENT_SUCCEEDED
340376 protoEvent .Event = & refproto.GameEvent_PlacementSucceeded_ {PlacementSucceeded : e .Details .PlacementSucceeded }
341377 case GameEventPrepared :
378+ * protoEvent .Type = refproto .GameEventType_PREPARED
342379 protoEvent .Event = & refproto.GameEvent_Prepared_ {Prepared : e .Details .Prepared }
343380 case GameEventBotSubstitution :
381+ * protoEvent .Type = refproto .GameEventType_BOT_SUBSTITUTION
344382 protoEvent .Event = & refproto.GameEvent_BotSubstitution_ {BotSubstitution : e .Details .BotSubstitution }
345383 case GameEventTooManyRobots :
384+ * protoEvent .Type = refproto .GameEventType_TOO_MANY_ROBOTS
346385 protoEvent .Event = & refproto.GameEvent_TooManyRobots_ {TooManyRobots : e .Details .TooManyRobots }
347386 default :
348387 log .Printf ("Warn: Could not map game event %v" , e .Type )
0 commit comments