// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com) // This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #include #include #include #include namespace Nz { void LifetimeSystem::Update(Time elapsedTime) { auto view = m_registry.view(entt::exclude); for (auto [entity, lifetimeComponent] : view.each()) { lifetimeComponent.DecreaseLifetime(elapsedTime); if (!lifetimeComponent.IsAlive()) m_registry.destroy(entity); } } }