changed git root

This commit is contained in:
Gebruiker
2022-10-23 01:23:27 +02:00
parent ef9159260b
commit 90448c79e4
12 changed files with 5 additions and 0 deletions

View File

@@ -1,37 +0,0 @@
module.exports = {
setup: function () { StructureSpawn.prototype = _Spawn.prototype; }
}
class _Spawn extends StructureSpawn {
init() {
}
requireNewCreep(role) {
const roleCount = this.room.find(FIND_MY_CREEPS, {
filter: (c) => { return c.memory.role == role; }
}).length;
switch (role) {
case ROLE_HARVESTER:
return roleCount < 10;
break;
default:
break;
}
}
createHarvester() {
var body = [WORK, CARRY, MOVE];
this.createCreep(body, "harvester", ROLE_HARVESTER);
}
createCreep(body, name, role) {
if (this.memory.creepCounter == undefined) this.memory.creepCounter = 0;
const response = this.spawnCreep(body, name + ": " + this.memory.creepCounter, {
memory: { role: role }
});
if (response == OK) this.memory.creepCounter++;
}
}