Implemented auto building of containers.

This commit is contained in:
2026-06-19 00:08:04 +02:00
parent fe039cbdcf
commit 50e8c81cf0
9 changed files with 74 additions and 32 deletions

View File

@@ -12,10 +12,10 @@ void DouwcoHivemind::Spawn::loop()
int energyAvailable = spawn.room().energyAvailable();
int energyCapacityAvailable = spawn.room().energyCapacityAvailable();
int required_upgraders = 1;
int required_suppliers = 1;
int required_maintainers = spawn.room().find(Screeps::FIND_MY_STRUCTURES).size() <= 2 ? 0 : 1;;
int required_maintainers = spawn.room().find(Screeps::FIND_STRUCTURES).size() <= 2 ? 0 : 1;;
int required_builders = spawn.room().find(Screeps::FIND_MY_CONSTRUCTION_SITES).size() == 0 ? 0 : 1;
for (auto &creep : Screeps::Game.creeps())
{
@@ -31,8 +31,8 @@ void DouwcoHivemind::Spawn::loop()
required_builders--;
}
if (energyAvailable < energyCapacityAvailable && 3 < Screeps::Game.creeps().size())
return;
// if (energyAvailable < energyCapacityAvailable && 3 < Screeps::Game.creeps().size())
// return;
std::string name;
JSON opts;
if (required_suppliers > 0)