-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.js
32 lines (27 loc) · 891 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
var roleHarvester = require('role.harvesterAdv');
var roleBuilder = require('role.builder');
var roleUpgrader = require('role.upgrader');
var energyManager = require('manager.energy');
var buildManager = require('manager.build');
module.exports.loop = function () {
console.log("Total room energy: " + energyManager.totalEnergy());
for(var name in Memory.creeps) {
if(!Game.creeps[name]) {
delete Memory.creeps[name];
}
}
buildManager.buildQueue();
buildManager.buildReport();
for(var name in Game.creeps) {
var creep = Game.creeps[name];
if(creep.memory.role == 'harvester') {
roleHarvester.run(creep);
}
if(creep.memory.role == 'upgrader') {
roleUpgrader.run(creep);
}
if(creep.memory.role == 'builder') {
roleBuilder.run(creep);
}
}
}