#include "Systems/ExplosionEffectSystem.h" void ExplosionEffectSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& component, double dt) { Field delay = component["Delay"]; if (delay > 0) { delay = std::max(0.0, delay - dt); } if (delay <= 0) { Field timeSinceDeath = component["TimeSinceDeath"]; timeSinceDeath += (Field)component["Speed"] * dt; if (timeSinceDeath < 0) { timeSinceDeath = 0.0; } else if (timeSinceDeath >(const double&)component["ExplosionDuration"]) { timeSinceDeath = (const double&)component["ExplosionDuration"]; } } }