This commit is contained in:
Jeremiah Billmann
2013-07-14 11:37:16 -04:00
parent f9409434bf
commit 4911079981
3 changed files with 12 additions and 4 deletions
@@ -31,5 +31,13 @@ EntityController.prototype = {
return;
}
}
},
setState: function (id, state) {
this.entities.some(function (entity) {
if (entity.client.id === id) {
entity.state = state;
return true;
}
});
}
};
+2 -2
View File
@@ -124,8 +124,8 @@ GarageServer.prototype.updatePlayerState = function (id, state) {
this.game.updatePlayerState(id, state);
};
GarageServer.prototype.addEntity = function (id) {
this.game.addEntity(id);
GarageServer.prototype.addEntity = function (id, state) {
this.game.addEntity(id, state);
};
GarageServer.prototype.removeEntity = function (id) {
+2 -2
View File
@@ -92,8 +92,8 @@ GarageServerGame.prototype.removePlayer = function (id) {
this.playerController.remove(id);
};
GarageServerGame.prototype.addEntity = function (id) {
this.entityController.add(id);
GarageServerGame.prototype.addEntity = function (id, state) {
this.entityController.add(id, state);
};
GarageServerGame.prototype.removeEntity = function (id) {