32 std::vector<ecs::Entity> entitiesToRemove;
36 projectile.current_lifetime += dt;
37 if (projectile.current_lifetime >= projectile.lifetime)
39 entitiesToRemove.push_back(entity);
45 (transform !=
nullptr) && (velocity !=
nullptr))
47 transform->
x += velocity->x * dt;
48 transform->y += velocity->y * dt;
52 for (
const auto &entity : entitiesToRemove)
This file contains the component definitions.
This file contains the IRenderer class declaration.
This file contains the interface for systems.
This file contains the Registry class declaration.
Abstract class for system.
Class for managing entities and their components.
bool hasComponent(Entity e)
std::unordered_map< Entity, T > & getAll()
T * getComponent(Entity e)
void removeComponent(Entity e)
~ProjectileSystem() override=default
void update(ecs::Registry ®istry, float dt) override
ProjectileSystem & operator=(ProjectileSystem &&)=delete
ProjectileSystem(ProjectileSystem &&)=delete
ProjectileSystem(const std::shared_ptr< eng::IRenderer > &)
ProjectileSystem(const ProjectileSystem &)=delete
ProjectileSystem & operator=(const ProjectileSystem &)=delete