First working version of colony.

Harversters and spawn work.
This commit is contained in:
douwe
2025-08-13 20:43:26 +02:00
parent 8a39526580
commit 9a1682a857
28 changed files with 1328 additions and 114 deletions

11
include/Constants.hpp Normal file
View File

@@ -0,0 +1,11 @@
#ifndef DOUWCO_HIVEMIND_CONSTANTS_HPP
#define DOUWCO_HIVEMIND_CONSTANTS_HPP
namespace DouwcoHivemind{
// Roles
const int ROLE_HARVESTER = 0;
}
#endif // DOUWCO_HIVEMIND_CONSTANTS_HPP

View File

@@ -0,0 +1,29 @@
#ifndef DOUWCO_HIVEMIND_HARVESTER_HPP
#define DOUWCO_HIVEMIND_HARVESTER_HPP
#include <Screeps/Creep.hpp>
namespace DouwcoHivemind
{
class HarvesterRole
{
private:
Screeps::Creep *creep;
JSON memory;
public:
HarvesterRole(Screeps::Creep* creep_pntr);
~HarvesterRole();
void process();
private:
void setupMemory();
void searchTarget();
void searchEnergyDeposit();
void searchSource();
void harvestSource();
void depositEnergy();
};
}
#endif // DOUWCO_HIVEMIND_HARVESTER_HPP

View File

@@ -1,10 +1,20 @@
class SpawnManager
{
private:
/* data */
public:
SpawnManager(){}
~SpawnManager(){}
#ifndef DOUWCO_HIVEMIND_SPAWN_HPP
#define DOUWCO_HIVEMIND_SPAWN_HPP
void process();
};
#include <Screeps/StructureSpawn.hpp>
namespace DouwcoHivemind
{
class Spawn
{
private:
Screeps::StructureSpawn *structure;
public:
Spawn(Screeps::StructureSpawn *structure_pntr) { structure = structure_pntr; }
~Spawn() {}
void process();
};
}
#endif // DOUWCO_HIVEMIND_SPAWN_HPP