// Copyright (C) 2017 Jérôme Leclercq // This file is part of the "Nazara Development Kit" // For conditions of distribution and use, see copyright notice in Prerequisites.hpp #include #include namespace Ndk { LifetimeSystem::LifetimeSystem() { Requires(); } void LifetimeSystem::OnUpdate(float elapsedTime) { for (const Ndk::EntityHandle& entity : GetEntities()) { auto& lifetime = entity->GetComponent(); if (lifetime.UpdateLifetime(elapsedTime)) entity->Kill(); } } SystemIndex LifetimeSystem::systemIndex; }