diff --git a/main.js b/main.js index 8574160..b45a9bb 100644 --- a/main.js +++ b/main.js @@ -8,7 +8,7 @@ var creepRolePriority = ['harvester', 'builder', 'upgrader', 'guard']; var creepsConfig = { harvester: { bodyParts: [WORK, CARRY, MOVE, MOVE, MOVE], - minimumCreeps: 2, + minimumCreeps: 3, role: roleHarvester }, builder: { @@ -18,12 +18,12 @@ var creepsConfig = { }, upgrader: { bodyParts: [WORK, CARRY, MOVE, MOVE, MOVE], - minimumCreeps: 3, + minimumCreeps: 4, role: roleUpgrader }, guard: { bodyParts: [TOUGH, MOVE, ATTACK, MOVE, ATTACK], - minimumCreeps: 2, + minimumCreeps: 3, role: roleGuard } }; @@ -59,12 +59,8 @@ module.exports.loop = function(){ } // Run stuff for each creep - var roleCounts = { - builder: 0, - harvester: 0, - upgrader: 0, - guard: 0 - } + var roleCounts = { builder: 0, harvester: 0, upgrader: 0, guard: 0 } + var expected = { builder: 0, harvester: 0, upgrader: 0, guard: 0 } for (var name in Game.creeps){ var creep = Game.creeps[name]; var role = creep.memory.role; @@ -72,6 +68,10 @@ module.exports.loop = function(){ creepsConfig[role].role.run(creep); } - console.log(JSON.stringify(roleCounts)); + for (var role in creepsConfig){ + expected[role] = creepsConfig[role].minimumCreeps; + } + console.log("current:", JSON.stringify(roleCounts)); + console.log("expect: ", JSON.stringify(expected)); console.log("#############################################################"); -}; \ No newline at end of file +};