mirror of
https://github.com/wassname/GarageServer.IO.git
synced 2026-06-27 16:10:34 +08:00
Progress #3
This commit is contained in:
@@ -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;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user