switch to ECS architecture
This commit is contained in:
@@ -9,6 +9,9 @@
|
||||
#include <QPoint>
|
||||
|
||||
#include "BeltSystem.h"
|
||||
#include "EntityAdmin.h"
|
||||
|
||||
#include "entt/entity/entity.hpp"
|
||||
#include "SchematicDropEvent.h"
|
||||
#include "BuildingType.h"
|
||||
#include "EntityId.h"
|
||||
@@ -73,6 +76,8 @@ public:
|
||||
const ShipSystem& ships() const;
|
||||
ScrapSystem& scraps();
|
||||
const ScrapSystem& scraps() const;
|
||||
EntityAdmin& admin();
|
||||
const EntityAdmin& admin() const;
|
||||
|
||||
private:
|
||||
EntityId allocateId(); // Strictly increasing; never returns kInvalidEntityId.
|
||||
@@ -100,10 +105,11 @@ private:
|
||||
bool m_gameOver = false;
|
||||
|
||||
// Pre-placed structure IDs.
|
||||
EntityId m_hqId;
|
||||
EntityId m_playerStation1Id;
|
||||
EntityId m_playerStation2Id;
|
||||
EntityId m_currentEnemyStationIds[2];
|
||||
EntityId m_hqBuildingId; // Building id (for belt integration)
|
||||
entt::entity m_hqProxyEntity; // ECS entity (HP, targeting)
|
||||
entt::entity m_playerStation1Entity;
|
||||
entt::entity m_playerStation2Entity;
|
||||
entt::entity m_currentEnemyStationEntities[2];
|
||||
|
||||
// Schematic unlock state (REQ-DEF-SCHEMATIC-DROP).
|
||||
struct SchematicState
|
||||
@@ -113,6 +119,7 @@ private:
|
||||
};
|
||||
std::map<std::string, SchematicState> m_schematicLevels;
|
||||
|
||||
EntityAdmin m_admin;
|
||||
BeltSystem m_beltSystem;
|
||||
std::unique_ptr<BuildingSystem> m_buildingSystem;
|
||||
std::unique_ptr<ShipSystem> m_shipSystem;
|
||||
|
||||
Reference in New Issue
Block a user