#pragma once #include #include #include #include "EcsComponents.h" #include "Tick.h" #include "entt/entity/entity.hpp" class EntityAdmin; struct ScrapInfo { entt::entity entity; QVector2D position; }; class ScrapSystem { public: explicit ScrapSystem(EntityAdmin& admin); entt::entity spawn(QVector2D position, int amount, Tick despawnAt); void tickDespawn(Tick currentTick); // Removes the scrap and returns its amount, or nullopt if not found. std::optional consume(entt::entity entity); // Lightweight snapshot for callers that need to iterate all scrap. std::vector allScrapInfo() const; private: EntityAdmin& m_admin; };