Added structure handling in engine as well.

This commit is contained in:
douwe
2025-08-22 01:13:09 +02:00
parent 0381ea6873
commit cd1464cc94
8 changed files with 53 additions and 20 deletions

View File

@@ -8,9 +8,9 @@
#include "Constants.hpp"
#include "Structures/Spawn.hpp"
void DouwcoHivemind::Spawn::process()
void DouwcoHivemind::Spawn::loop()
{
int creepcount = structure->room().find(Screeps::FIND_MY_CREEPS).size();
int creepcount = spawn.room().find(Screeps::FIND_MY_CREEPS).size();
if (creepcount > 10)
{
EM_ASM({ console.log('To much creeps in this room'); });
@@ -21,7 +21,7 @@ void DouwcoHivemind::Spawn::process()
JSON opts;
opts["memory"]["role"] = Roles::HARVESTER;
int resp = structure->spawnCreep(
int resp = spawn.spawnCreep(
{"work", "carry", "move"},
"harvester" + std::to_string(Screeps::Game.time()),
opts);