Moved remove into base

This commit is contained in:
Jeremiah Billmann
2013-07-06 14:23:41 -04:00
parent 8290aa31fa
commit 85458c47b9
2 changed files with 6 additions and 10 deletions
+6 -1
View File
@@ -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) {