@@ -252,51 +252,35 @@ func stateChanged(s1, s2 *state.State) bool {
252
252
if s1 == nil || s2 == nil {
253
253
return true
254
254
}
255
- if * s1 .Stage != * s2 .Stage {
256
- return true
257
- }
258
- if ! reflect .DeepEqual (s1 .Command , s2 .Command ) {
259
- return true
260
- }
261
255
if s1 .StageTimeElapsed .Seconds != s2 .StageTimeElapsed .Seconds {
262
256
return true
263
257
}
264
258
if s1 .StageTimeLeft .Seconds != s2 .StageTimeLeft .Seconds {
265
259
return true
266
260
}
267
- if ! reflect . DeepEqual ( s1 .MatchTimeStart , s2 .MatchTimeStart ) {
261
+ if s1 .CurrentActionTimeRemaining . Seconds != s2 .CurrentActionTimeRemaining . Seconds {
268
262
return true
269
263
}
270
264
for _ , team := range state .BothTeams () {
271
265
if teamStateChanged (s1 .TeamInfo (team ), s2 .TeamInfo (team )) {
272
266
return true
273
267
}
274
268
}
275
- if ! reflect .DeepEqual (s1 .PlacementPos , s2 .PlacementPos ) {
276
- return true
277
- }
278
- if ! reflect .DeepEqual (s1 .NextCommand , s2 .NextCommand ) {
279
- return true
280
- }
281
- if s1 .CurrentActionTimeRemaining .Seconds != s2 .CurrentActionTimeRemaining .Seconds {
282
- return true
283
- }
284
- if ! reflect .DeepEqual (s1 .GameEvents , s2 .GameEvents ) {
285
- return true
286
- }
287
- if ! reflect .DeepEqual (s1 .GameEventProposals , s2 .GameEventProposals ) {
288
- return true
289
- }
290
- if * s1 .Division != * s2 .Division {
291
- return true
292
- }
293
- if * s1 .AutoContinue != * s2 .AutoContinue {
294
- return true
295
- }
296
- if * s1 .FirstKickoffTeam != * s2 .FirstKickoffTeam {
297
- return true
298
- }
299
- return false
269
+
270
+ s1c := new (state.State )
271
+ s2c := new (state.State )
272
+ proto .Merge (s1c , s1 )
273
+ proto .Merge (s2c , s2 )
274
+ s1c .StageTimeElapsed = nil
275
+ s2c .StageTimeElapsed = nil
276
+ s1c .StageTimeLeft = nil
277
+ s2c .StageTimeLeft = nil
278
+ s1c .CurrentActionTimeRemaining = nil
279
+ s2c .CurrentActionTimeRemaining = nil
280
+ s1c .TeamState = nil
281
+ s2c .TeamState = nil
282
+
283
+ return ! proto .Equal (s1c , s2c )
300
284
}
301
285
302
286
func teamStateChanged (s1 , s2 * state.TeamInfo ) bool {
0 commit comments