Skip to content

Instantly share code, notes, and snippets.

@utiuti
Created July 5, 2015 17:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save utiuti/5f54443b2ea8cd6940d9 to your computer and use it in GitHub Desktop.
Save utiuti/5f54443b2ea8cd6940d9 to your computer and use it in GitHub Desktop.
Question about prototypes in separate files
module.exports = function () {
Room.prototype.findCreeps = function (role) {
var creeps = room.find(FIND_MY_CREEPS);
if (role && role != "") {
creeps = _.filter(creeps, function (c) {
return (c.memory.role == role);
});
}
return creeps;
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment