11import * as config from '../config.js'
2- import { ErrorLog } from '../core/ErrorLog.js'
3- import { demo as defaultDemo } from '../demo.js'
2+ import { ErrorLog } from '../core/ErrorLog.js'
3+ import { demo as defaultDemo } from '../demo.js'
44import Parser from './lib/Parser.js'
55import './player.js'
66
@@ -38,6 +38,10 @@ function PlayerCtrl ($scope, $timeout, $interval, $filter, $element) {
3838
3939 $interval ( checkSize , 1000 )
4040
41+ $scope . isEmptyObject = function ( obj ) {
42+ return angular . equals ( obj , { } )
43+ }
44+
4145 $scope . errors = { }
4246 ErrorLog . listen ( function ( error ) {
4347 addError ( error )
@@ -49,7 +53,7 @@ function PlayerCtrl ($scope, $timeout, $interval, $filter, $element) {
4953 errorText += error . cause + '\n'
5054 }
5155 if ( ! $scope . errors [ errorText ] ) {
52- $scope . errors [ errorText ] = { quantity : 1 }
56+ $scope . errors [ errorText ] = { quantity : 1 }
5357 } else {
5458 $scope . errors [ errorText ] . quantity += 1
5559 }
@@ -101,7 +105,7 @@ function PlayerCtrl ($scope, $timeout, $interval, $filter, $element) {
101105 $scope . gameLoaded = true
102106 $scope . uinput = ctrl . data . uinput
103107 ctrl . gameInfo = convertFrameFormat ( ctrl . data )
104- $scope . agents = { ...ctrl . data . agents }
108+ $scope . agents = { ...ctrl . data . agents }
105109
106110 cgPlayer . sendFrames ( ctrl . gameInfo )
107111 cgPlayer . subscribe ( onUpdate )
@@ -151,7 +155,7 @@ function PlayerCtrl ($scope, $timeout, $interval, $filter, $element) {
151155 let f = v . split ( '\n' )
152156 let header = f [ 0 ] . split ( ' ' )
153157
154- return { view : v . replace ( / ^ ( K E Y _ F R A M E ) | ( I N T E R M E D I A T E _ F R A M E ) / , '' ) , keyframe : header [ 0 ] === 'KEY_FRAME' }
158+ return { view : v . replace ( / ^ ( K E Y _ F R A M E ) | ( I N T E R M E D I A T E _ F R A M E ) / , '' ) , keyframe : header [ 0 ] === 'KEY_FRAME' }
155159 } )
156160 for ( let i = 0 ; i < frames . length ; i ++ ) {
157161 frames [ i ] . gameSummary = data . summaries [ i ]
@@ -161,9 +165,9 @@ function PlayerCtrl ($scope, $timeout, $interval, $filter, $element) {
161165 }
162166 frames [ i ] . agentId = - 1
163167 }
164- const agents = data . agents . map ( a => Object . assign ( a , { avatarUrl : a . avatar } ) )
168+ const agents = data . agents . map ( a => Object . assign ( a , { avatarUrl : a . avatar } ) )
165169 const tooltips = data . tooltips . map ( JSON . stringify )
166- return { agents : agents , frames : frames , tooltips : tooltips }
170+ return { agents : agents , frames : frames , tooltips : tooltips }
167171 }
168172
169173 function checkSize ( ) {
0 commit comments