mirror of
https://github.com/wassname/GarageServer.IO.git
synced 2026-06-27 16:10:34 +08:00
Moved remove into base
This commit is contained in:
@@ -25,6 +25,11 @@ EntityController.prototype = {
|
||||
return newEntity;
|
||||
},
|
||||
remove: function (id) {
|
||||
|
||||
for (var i = 0; i < this.entities.length; i ++) {
|
||||
if (this.entities[i].id === id) {
|
||||
this.entities.splice(i, 1)[0];
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -27,15 +27,6 @@ PlayerController.prototype.add = function (client) {
|
||||
return newPlayer;
|
||||
};
|
||||
|
||||
PlayerController.prototype.remove = function (id) {
|
||||
for (var i = 0; i < this.entities.length; i ++) {
|
||||
if (this.entities[i].client.id === id) {
|
||||
this.entities.splice(i, 1)[0];
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
PlayerController.prototype.addInput = function (id, input, sequence, time) {
|
||||
this.entities.some(function (player) {
|
||||
if (player.client.id === id) {
|
||||
|
||||
Reference in New Issue
Block a user