#ifndef DOUWCO_HIVEMIND_HARVESTER_HPP #define DOUWCO_HIVEMIND_HARVESTER_HPP #include #include "Creeps/Creep.hpp" namespace DouwcoHivemind { class HarvesterRole : public Creep { private: bool harvesting; int taskCounter; public: HarvesterRole(Screeps::Creep crp) : Creep(crp) { harvesting = memory.contains("harvesting") ? static_cast(memory["harvesting"]) : false; taskCounter = memory.contains("taskCounter") ? static_cast(memory["taskCounter"]) : 0; } ~HarvesterRole() override { memory["harvesting"] = harvesting; memory["taskCounter"] = taskCounter; } void loop() override; private: void harvestSource(); std::unique_ptr getSourceTarget(); void searchSource(); void depositEnergy(); std::unique_ptr getDepositTarget(); void searchDeposit(); }; } #endif // DOUWCO_HIVEMIND_HARVESTER_HPP