From cb794e0de74ca04d0360be7ae98486e8791d4b89 Mon Sep 17 00:00:00 2001 From: Jeremiah Billmann Date: Thu, 27 Jun 2013 20:10:43 -0400 Subject: [PATCH] Code cleanup --- client/garageserver.io.js | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/client/garageserver.io.js b/client/garageserver.io.js index 682b070..de76d5f 100644 --- a/client/garageserver.io.js +++ b/client/garageserver.io.js @@ -217,11 +217,11 @@ window.GarageServerIO = (function (window, socketio) { _stateController.frameTime = new Date().getTime(); _stateController.delta = data.delta; - updatePlayerState(data); - updateEntityState(data); + updatePlayersState(data); + updateEntitiesState(data); }, - updatePlayerState = function (data) { + updatePlayersState = function (data) { var playerFound = false, stateIdx = 0, playerState; @@ -256,11 +256,21 @@ window.GarageServerIO = (function (window, socketio) { } } }, - - updateEntityState = function (data) { + + updateEntitiesState = function (data) { }, - + + getPlayerStates = function (stateCallback) { + if(_options.interpolation && _options.onInterpolation) { + getPlayerStatesInterpolated(stateCallback); + } + else { + getPlayerStatesCurrent(stateCallback); + } + stateCallback(_stateController.state); + }, + getPlayerStatesCurrent = function (stateCallback) { _playerController.forEach(function (player) { if (player.anyUpdates()) { @@ -282,16 +292,6 @@ window.GarageServerIO = (function (window, socketio) { } } }); - }, - - getPlayerStates = function (stateCallback) { - if(_options.interpolation && _options.onInterpolation) { - getPlayerStatesInterpolated(stateCallback); - } - else { - getPlayerStatesCurrent(stateCallback); - } - stateCallback(_stateController.state); }; return {