switch to ECS architecture

This commit is contained in:
2026-05-22 20:31:39 +02:00
parent c18c4e4804
commit ca07cbaf0e
34 changed files with 1943 additions and 2074 deletions

View File

@@ -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;