SharedRevenantOverloadedLightsSystem.cs 768 B

1234567891011121314151617181920212223242526272829
  1. using Content.Shared.Revenant.Components;
  2. namespace Content.Shared.Revenant.EntitySystems;
  3. /// <summary>
  4. /// This handles...
  5. /// </summary>
  6. public abstract class SharedRevenantOverloadedLightsSystem : EntitySystem
  7. {
  8. public override void Update(float frameTime)
  9. {
  10. base.Update(frameTime);
  11. var enumerator = EntityQueryEnumerator<RevenantOverloadedLightsComponent>();
  12. while (enumerator.MoveNext(out var uid, out var comp))
  13. {
  14. comp.Accumulator += frameTime;
  15. if (comp.Accumulator < comp.ZapDelay)
  16. continue;
  17. OnZap((uid, comp));
  18. RemCompDeferred(uid, comp);
  19. }
  20. }
  21. protected abstract void OnZap(Entity<RevenantOverloadedLightsComponent> component);
  22. }