50 lines
1.2 KiB
C++
50 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include <unordered_map>
|
|
#include <vector>
|
|
|
|
#include <QVector2D>
|
|
|
|
#include "entt/entity/entity.hpp"
|
|
|
|
class EntityAdmin;
|
|
|
|
// Shared, per-call target snapshots used by behavior evaluators and the repair
|
|
// system. Each caller builds its own snapshot (no cross-system caching).
|
|
|
|
struct RepairableInfo
|
|
{
|
|
entt::entity entity;
|
|
QVector2D position;
|
|
bool isEnemy;
|
|
bool isShip;
|
|
float hp;
|
|
float maxHp;
|
|
};
|
|
|
|
struct CombatantInfo
|
|
{
|
|
entt::entity entity;
|
|
QVector2D position;
|
|
bool isEnemy;
|
|
bool isStation;
|
|
};
|
|
|
|
struct CargoState
|
|
{
|
|
int current = 0;
|
|
int capacity = 0;
|
|
};
|
|
|
|
// All ships and stations with health — candidates for repair targeting.
|
|
std::vector<RepairableInfo> buildRepairables(EntityAdmin& admin);
|
|
|
|
// All ships, stations, and the HQ proxy — candidates for attack targeting.
|
|
std::vector<CombatantInfo> buildCombatants(EntityAdmin& admin);
|
|
|
|
// Aggregated salvage cargo per owning ship, summed across its salvage modules.
|
|
std::unordered_map<entt::entity, CargoState> buildCargoByShip(EntityAdmin& admin);
|
|
|
|
// True when the ship's aggregated cargo is at capacity (and it has any capacity).
|
|
bool isCargoFull(const CargoState& cargo);
|