move ecs related code to own folder

This commit is contained in:
2026-05-25 08:46:58 +02:00
parent 8ad7530740
commit 25ff3c56c5
54 changed files with 877 additions and 680 deletions

View File

@@ -0,0 +1,41 @@
#pragma once
#include <optional>
#include <string>
#include <QVector2D>
#include "GameConfig.h"
#include "ShipLayout.h"
#include "entt/entity/entity.hpp"
class EntityAdmin;
class ShipSystem
{
public:
ShipSystem(const GameConfig& config, EntityAdmin& admin);
entt::entity spawn(const std::string& schematicId, int level, QVector2D position,
bool isEnemy = false,
const std::optional<ShipLayoutConfig>& layout = std::nullopt);
void despawn(entt::entity entity);
// Reset all movement intents to priority 0 before behavior systems run.
void clearMovementIntents();
// Set the rally point that newly spawned player combat ships will loiter at.
void setRallyPoint(QVector2D point);
// Release all gathered player combat ships to advance toward the enemy.
void triggerRallyDeparture();
private:
const ShipDef* findShipDef(const std::string& schematicId) const;
const ModuleDef* findModuleDef(const std::string& id) const;
const GameConfig& m_config;
EntityAdmin& m_admin;
QVector2D m_rallyPoint;
};