Code cleanup

This commit is contained in:
Jeremiah Billmann
2013-07-12 11:11:30 -05:00
parent 2ca0208fb0
commit 906bf3719a
4 changed files with 32 additions and 22 deletions
+4
View File
@@ -110,6 +110,10 @@ GarageServer.prototype.start = function () {
this.game.start();
};
GarageServer.prototype.stop = function () {
this.game.stop();
};
GarageServer.prototype.getPlayers = function () {
return this.game.getPlayers();
};
+6 -2
View File
@@ -16,10 +16,14 @@ GarageServerGame.prototype.start = function () {
var self = this;
this.startTime = new Date().getTime();
this.stateIntervalId = setInterval(function () { self.updateState(self.options); }, this.stateInterval);
this.stateIntervalId = setInterval(function () { self.updateState(); }, this.stateInterval);
};
GarageServerGame.prototype.updateState = function (options) {
GarageServerGame.prototype.stop = function () {
clearInterval(this.stateIntervalId);
};
GarageServerGame.prototype.updateState = function () {
var currentTime = new Date().getTime() - this.startTime,
state = { time: currentTime, playerStates: [], entityStates: [] };