@@ -265,84 +265,123 @@ func (e GameEvent) IsContinueGame() bool {
265
265
// ToProto converts the internal game event into a protobuf game event
266
266
func (e GameEvent ) ToProto () * refproto.GameEvent {
267
267
protoEvent := new (refproto.GameEvent )
268
+ protoEvent .Type = new (refproto.GameEventType )
268
269
switch e .Type {
269
270
case GameEventNone :
270
271
return nil
271
272
case GameEventBallLeftFieldGoalLine :
273
+ * protoEvent .Type = refproto .GameEventType_BALL_LEFT_FIELD_GOAL_LINE
272
274
protoEvent .Event = & refproto.GameEvent_BallLeftFieldGoalLine {BallLeftFieldGoalLine : e .Details .BallLeftFieldGoalLine }
273
275
case GameEventBallLeftFieldTouchLine :
276
+ * protoEvent .Type = refproto .GameEventType_BALL_LEFT_FIELD_TOUCH_LINE
274
277
protoEvent .Event = & refproto.GameEvent_BallLeftFieldTouchLine {BallLeftFieldTouchLine : e .Details .BallLeftFieldTouchLine }
275
278
case GameEventAimlessKick :
279
+ * protoEvent .Type = refproto .GameEventType_AIMLESS_KICK
276
280
protoEvent .Event = & refproto.GameEvent_AimlessKick_ {AimlessKick : e .Details .AimlessKick }
277
281
case GameEventGoal :
282
+ * protoEvent .Type = refproto .GameEventType_GOAL
278
283
protoEvent .Event = & refproto.GameEvent_Goal_ {Goal : e .Details .Goal }
279
284
case GameEventPossibleGoal :
285
+ * protoEvent .Type = refproto .GameEventType_POSSIBLE_GOAL
280
286
protoEvent .Event = & refproto.GameEvent_PossibleGoal {PossibleGoal : e .Details .PossibleGoal }
281
287
case GameEventIndirectGoal :
288
+ * protoEvent .Type = refproto .GameEventType_INDIRECT_GOAL
282
289
protoEvent .Event = & refproto.GameEvent_IndirectGoal_ {IndirectGoal : e .Details .IndirectGoal }
283
290
case GameEventChippedGoal :
291
+ * protoEvent .Type = refproto .GameEventType_CHIPPED_GOAL
284
292
protoEvent .Event = & refproto.GameEvent_ChippedGoal_ {ChippedGoal : e .Details .ChippedGoal }
285
293
case GameEventBotTooFastInStop :
294
+ * protoEvent .Type = refproto .GameEventType_BOT_TOO_FAST_IN_STOP
286
295
protoEvent .Event = & refproto.GameEvent_BotTooFastInStop_ {BotTooFastInStop : e .Details .BotTooFastInStop }
287
296
case GameEventBotTippedOver :
297
+ * protoEvent .Type = refproto .GameEventType_BOT_TIPPED_OVER
288
298
protoEvent .Event = & refproto.GameEvent_BotTippedOver_ {BotTippedOver : e .Details .BotTippedOver }
289
299
case GameEventBotInterferedPlacement :
300
+ * protoEvent .Type = refproto .GameEventType_BOT_INTERFERED_PLACEMENT
290
301
protoEvent .Event = & refproto.GameEvent_BotInterferedPlacement_ {BotInterferedPlacement : e .Details .BotInterferedPlacement }
291
302
case GameEventBotCrashDrawn :
303
+ * protoEvent .Type = refproto .GameEventType_BOT_CRASH_DRAWN
292
304
protoEvent .Event = & refproto.GameEvent_BotCrashDrawn_ {BotCrashDrawn : e .Details .BotCrashDrawn }
293
305
case GameEventBotKickedBallTooFast :
306
+ * protoEvent .Type = refproto .GameEventType_BOT_KICKED_BALL_TOO_FAST
294
307
protoEvent .Event = & refproto.GameEvent_BotKickedBallTooFast_ {BotKickedBallTooFast : e .Details .BotKickedBallTooFast }
295
308
case GameEventBotDribbledBallTooFar :
309
+ * protoEvent .Type = refproto .GameEventType_BOT_DRIBBLED_BALL_TOO_FAR
296
310
protoEvent .Event = & refproto.GameEvent_BotDribbledBallTooFar_ {BotDribbledBallTooFar : e .Details .BotDribbledBallTooFar }
297
311
case GameEventBotCrashUnique :
312
+ * protoEvent .Type = refproto .GameEventType_BOT_CRASH_UNIQUE
298
313
protoEvent .Event = & refproto.GameEvent_BotCrashUnique_ {BotCrashUnique : e .Details .BotCrashUnique }
299
314
case GameEventBotCrashUniqueSkipped :
315
+ * protoEvent .Type = refproto .GameEventType_BOT_CRASH_UNIQUE_SKIPPED
300
316
protoEvent .Event = & refproto.GameEvent_BotCrashUniqueSkipped {BotCrashUniqueSkipped : e .Details .BotCrashUniqueSkipped }
301
317
case GameEventBotPushedBot :
318
+ * protoEvent .Type = refproto .GameEventType_BOT_PUSHED_BOT
302
319
protoEvent .Event = & refproto.GameEvent_BotPushedBot_ {BotPushedBot : e .Details .BotPushedBot }
303
320
case GameEventBotPushedBotSkipped :
321
+ * protoEvent .Type = refproto .GameEventType_BOT_PUSHED_BOT_SKIPPED
304
322
protoEvent .Event = & refproto.GameEvent_BotPushedBotSkipped {BotPushedBotSkipped : e .Details .BotPushedBotSkipped }
305
323
case GameEventBotHeldBallDeliberately :
324
+ * protoEvent .Type = refproto .GameEventType_BOT_HELD_BALL_DELIBERATELY
306
325
protoEvent .Event = & refproto.GameEvent_BotHeldBallDeliberately_ {BotHeldBallDeliberately : e .Details .BotHeldBallDeliberately }
307
326
case GameEventAttackerDoubleTouchedBall :
327
+ * protoEvent .Type = refproto .GameEventType_ATTACKER_DOUBLE_TOUCHED_BALL
308
328
protoEvent .Event = & refproto.GameEvent_AttackerDoubleTouchedBall_ {AttackerDoubleTouchedBall : e .Details .AttackerDoubleTouchedBall }
309
329
case GameEventAttackerTooCloseToDefenseArea :
330
+ * protoEvent .Type = refproto .GameEventType_ATTACKER_TOO_CLOSE_TO_DEFENSE_AREA
310
331
protoEvent .Event = & refproto.GameEvent_AttackerTooCloseToDefenseArea_ {AttackerTooCloseToDefenseArea : e .Details .AttackerTooCloseToDefenseArea }
311
332
case GameEventAttackerInDefenseArea :
333
+ * protoEvent .Type = refproto .GameEventType_ATTACKER_IN_DEFENSE_AREA
312
334
protoEvent .Event = & refproto.GameEvent_AttackerInDefenseArea_ {AttackerInDefenseArea : e .Details .AttackerInDefenseArea }
313
335
case GameEventAttackerTouchedKeeper :
336
+ * protoEvent .Type = refproto .GameEventType_ATTACKER_TOUCHED_KEEPER
314
337
protoEvent .Event = & refproto.GameEvent_AttackerTouchedKeeper_ {AttackerTouchedKeeper : e .Details .AttackerTouchedKeeper }
315
338
case GameEventDefenderTooCloseToKickPoint :
339
+ * protoEvent .Type = refproto .GameEventType_DEFENDER_TOO_CLOSE_TO_KICK_POINT
316
340
protoEvent .Event = & refproto.GameEvent_DefenderTooCloseToKickPoint_ {DefenderTooCloseToKickPoint : e .Details .DefenderTooCloseToKickPoint }
317
341
case GameEventDefenderInDefenseAreaPartially :
342
+ * protoEvent .Type = refproto .GameEventType_DEFENDER_IN_DEFENSE_AREA_PARTIALLY
318
343
protoEvent .Event = & refproto.GameEvent_DefenderInDefenseAreaPartially_ {DefenderInDefenseAreaPartially : e .Details .DefenderInDefenseAreaPartially }
319
344
case GameEventDefenderInDefenseArea :
345
+ * protoEvent .Type = refproto .GameEventType_DEFENDER_IN_DEFENSE_AREA
320
346
protoEvent .Event = & refproto.GameEvent_DefenderInDefenseArea_ {DefenderInDefenseArea : e .Details .DefenderInDefenseArea }
321
347
case GameEventKeeperHeldBall :
348
+ * protoEvent .Type = refproto .GameEventType_KEEPER_HELD_BALL
322
349
protoEvent .Event = & refproto.GameEvent_KeeperHeldBall_ {KeeperHeldBall : e .Details .KeeperHeldBall }
323
350
case GameEventUnsportingBehaviorMinor :
351
+ * protoEvent .Type = refproto .GameEventType_UNSPORTING_BEHAVIOR_MINOR
324
352
protoEvent .Event = & refproto.GameEvent_UnsportingBehaviorMinor_ {UnsportingBehaviorMinor : e .Details .UnsportingBehaviorMinor }
325
353
case GameEventUnsportingBehaviorMajor :
354
+ * protoEvent .Type = refproto .GameEventType_UNSPORTING_BEHAVIOR_MAJOR
326
355
protoEvent .Event = & refproto.GameEvent_UnsportingBehaviorMajor_ {UnsportingBehaviorMajor : e .Details .UnsportingBehaviorMajor }
327
356
case GameEventMultipleCards :
357
+ * protoEvent .Type = refproto .GameEventType_MULTIPLE_CARDS
328
358
protoEvent .Event = & refproto.GameEvent_MultipleCards_ {MultipleCards : e .Details .MultipleCards }
329
359
case GameEventMultipleFouls :
360
+ * protoEvent .Type = refproto .GameEventType_MULTIPLE_FOULS
330
361
protoEvent .Event = & refproto.GameEvent_MultipleFouls_ {MultipleFouls : e .Details .MultipleFouls }
331
362
case GameEventMultiplePlacementFailures :
363
+ * protoEvent .Type = refproto .GameEventType_MULTIPLE_PLACEMENT_FAILURES
332
364
protoEvent .Event = & refproto.GameEvent_MultiplePlacementFailures_ {MultiplePlacementFailures : e .Details .MultiplePlacementFailures }
333
365
case GameEventKickTimeout :
366
+ * protoEvent .Type = refproto .GameEventType_KICK_TIMEOUT
334
367
protoEvent .Event = & refproto.GameEvent_KickTimeout_ {KickTimeout : e .Details .KickTimeout }
335
368
case GameEventNoProgressInGame :
369
+ * protoEvent .Type = refproto .GameEventType_NO_PROGRESS_IN_GAME
336
370
protoEvent .Event = & refproto.GameEvent_NoProgressInGame_ {NoProgressInGame : e .Details .NoProgressInGame }
337
371
case GameEventPlacementFailed :
372
+ * protoEvent .Type = refproto .GameEventType_PLACEMENT_FAILED
338
373
protoEvent .Event = & refproto.GameEvent_PlacementFailed_ {PlacementFailed : e .Details .PlacementFailed }
339
374
case GameEventPlacementSucceeded :
375
+ * protoEvent .Type = refproto .GameEventType_PLACEMENT_SUCCEEDED
340
376
protoEvent .Event = & refproto.GameEvent_PlacementSucceeded_ {PlacementSucceeded : e .Details .PlacementSucceeded }
341
377
case GameEventPrepared :
378
+ * protoEvent .Type = refproto .GameEventType_PREPARED
342
379
protoEvent .Event = & refproto.GameEvent_Prepared_ {Prepared : e .Details .Prepared }
343
380
case GameEventBotSubstitution :
381
+ * protoEvent .Type = refproto .GameEventType_BOT_SUBSTITUTION
344
382
protoEvent .Event = & refproto.GameEvent_BotSubstitution_ {BotSubstitution : e .Details .BotSubstitution }
345
383
case GameEventTooManyRobots :
384
+ * protoEvent .Type = refproto .GameEventType_TOO_MANY_ROBOTS
346
385
protoEvent .Event = & refproto.GameEvent_TooManyRobots_ {TooManyRobots : e .Details .TooManyRobots }
347
386
default :
348
387
log .Printf ("Warn: Could not map game event %v" , e .Type )
0 commit comments