@@ -153,13 +153,33 @@ type EventStage struct {
153153 StageOperation StageOperation `json:"stageOperation"`
154154}
155155
156+ type EventGameEvent struct {
157+ BallLeftFieldTouchLine * EventGameEventBallLeftField `json:"ballLeftFieldTouchLine"`
158+ BallLeftFieldGoalLine * EventGameEventBallLeftField `json:"ballLeftFieldGoalLine"`
159+ }
160+
161+ type EventGameEventBallLeftField struct {
162+ Team Team `json:"team"`
163+ }
164+
165+ func (e EventGameEvent ) String () string {
166+ if e .BallLeftFieldTouchLine != nil {
167+ return fmt .Sprintf ("Ball left field through touch line by %v" , e .BallLeftFieldTouchLine .Team )
168+ }
169+ if e .BallLeftFieldGoalLine != nil {
170+ return fmt .Sprintf ("Ball left field through goal line by %v" , e .BallLeftFieldGoalLine .Team )
171+ }
172+ return "unknown"
173+ }
174+
156175// Event holds all possible events. Only one at a time can be applied
157176type Event struct {
158- Card * EventCard `json:"card"`
159- Command * EventCommand `json:"command"`
160- Modify * EventModifyValue `json:"modify"`
161- Stage * EventStage `json:"stage"`
162- Trigger * EventTrigger `json:"trigger"`
177+ Card * EventCard `json:"card"`
178+ Command * EventCommand `json:"command"`
179+ Modify * EventModifyValue `json:"modify"`
180+ Stage * EventStage `json:"stage"`
181+ Trigger * EventTrigger `json:"trigger"`
182+ GameEvent * EventGameEvent `json:"gameEvent"`
163183}
164184
165185func (e Event ) String () string {
@@ -178,5 +198,8 @@ func (e Event) String() string {
178198 if e .Trigger != nil {
179199 return fmt .Sprintf ("Trigger: %v" , * e .Trigger )
180200 }
201+ if e .GameEvent != nil {
202+ return fmt .Sprintf ("GameEvent: %v" , * e .GameEvent )
203+ }
181204 return "empty event"
182205}
0 commit comments