Building Room based placement system.
This commit is contained in:
@@ -4,25 +4,32 @@
|
||||
#include <vector>
|
||||
|
||||
#include "Creeps/CreepBase.hpp"
|
||||
#include "Room.hpp"
|
||||
#include "Structures/StructureBase.hpp"
|
||||
|
||||
namespace DouwcoHivemind
|
||||
{
|
||||
class Engine
|
||||
{
|
||||
private:
|
||||
std::vector<std::unique_ptr<CreepBase>> creeps;
|
||||
std::vector<std::unique_ptr<StructureBase>> structures;
|
||||
namespace DouwcoHivemind {
|
||||
class Engine {
|
||||
private:
|
||||
std::vector<std::unique_ptr<Room>> rooms;
|
||||
std::vector<std::unique_ptr<CreepBase>> creeps;
|
||||
std::vector<std::unique_ptr<StructureBase>> structures;
|
||||
|
||||
public:
|
||||
Engine();
|
||||
void loop();
|
||||
public:
|
||||
// Readout data from screeps API into C++ vectors
|
||||
Engine();
|
||||
// Loop over all rooms, screeps and structures
|
||||
void loop();
|
||||
|
||||
private:
|
||||
void ReadOutCreeps();
|
||||
void ReadOutStructures();
|
||||
void clearDeadCreepMemory();
|
||||
};
|
||||
private:
|
||||
// Readout player owned rooms
|
||||
void ReadOutRooms();
|
||||
// Readout player owned screeps and assign their roles
|
||||
void ReadOutCreeps();
|
||||
// Readout player owned buildings based on their structure type
|
||||
void ReadOutStructures();
|
||||
// Clear dead screep memory
|
||||
void clearDeadCreepMemory();
|
||||
};
|
||||
}
|
||||
|
||||
#endif // DOUWCO_HIVEMIND_ENGINE_HPP
|
||||
31
douwco_hivemind/include/Room.hpp
Normal file
31
douwco_hivemind/include/Room.hpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef DOUWCO_HIVEMIND_ROOM_HPP
|
||||
#define DOUWCO_HIVEMIND_ROOM_HPP
|
||||
|
||||
#include <Screeps/Room.hpp>
|
||||
|
||||
namespace DouwcoHivemind {
|
||||
class Room {
|
||||
|
||||
protected:
|
||||
enum ProgressState {
|
||||
PLANNED,
|
||||
IN_PROGRESS,
|
||||
FINISHED
|
||||
};
|
||||
|
||||
Screeps::Room room;
|
||||
JSON memory;
|
||||
ProgressState _sourceContainerState;
|
||||
|
||||
public:
|
||||
Room(Screeps::Room rm);
|
||||
~Room();
|
||||
|
||||
void loop();
|
||||
|
||||
protected:
|
||||
bool assignConstructionSites();
|
||||
};
|
||||
} // namespace DouwcoHivemind
|
||||
|
||||
#endif // DOUWCO_HIVEMIND_ROOM_HPP
|
||||
Reference in New Issue
Block a user