44 lines
847 B
C++
44 lines
847 B
C++
#ifndef DOUWCO_HIVEMIND_CREEP_HPP
|
|
#define DOUWCO_HIVEMIND_CREEP_HPP
|
|
|
|
#include <Screeps/Creep.hpp>
|
|
|
|
namespace Screeps{
|
|
class RoomPosition;
|
|
class RoomObject;
|
|
class PathStep;
|
|
}
|
|
|
|
namespace DouwcoHivemind
|
|
{
|
|
enum CreepRole
|
|
{
|
|
UNEMPLOYED,
|
|
HARVESTER_SUPPLIER,
|
|
HARVESTER_UPGRADER,
|
|
HARVESTER_BUILDER
|
|
};
|
|
|
|
class Creep
|
|
{
|
|
public:
|
|
CreepRole role;
|
|
std::string target_id;
|
|
|
|
protected:
|
|
Screeps::Creep creep;
|
|
JSON memory;
|
|
|
|
public:
|
|
Creep(Screeps::Creep crp);
|
|
virtual ~Creep();
|
|
virtual void loop() {}
|
|
bool isNearTo(const Screeps::RoomPosition &pos, int dist);
|
|
|
|
protected:
|
|
void moveToTarget(int dist = 1);
|
|
std::unique_ptr<Screeps::RoomObject> getRoomObjectTarget();
|
|
};
|
|
}
|
|
|
|
#endif // DOUWCO_HIVEMIND_CREEP_HPP
|