Files
OldThink/Content.Shared/Revenant/EntitySystems/SharedRevenantOverloadedLightsSystem.cs

30 lines
768 B
C#
Raw Permalink Normal View History

using Content.Shared.Revenant.Components;
namespace Content.Shared.Revenant.EntitySystems;
/// <summary>
/// This handles...
/// </summary>
public abstract class SharedRevenantOverloadedLightsSystem : EntitySystem
{
public override void Update(float frameTime)
{
base.Update(frameTime);
2022-11-07 03:33:44 +11:00
var enumerator = EntityQueryEnumerator<RevenantOverloadedLightsComponent>();
2023-09-11 19:18:06 +10:00
while (enumerator.MoveNext(out var uid, out var comp))
{
comp.Accumulator += frameTime;
if (comp.Accumulator < comp.ZapDelay)
continue;
OnZap((uid, comp));
2023-09-11 19:18:06 +10:00
RemCompDeferred(uid, comp);
}
}
protected abstract void OnZap(Entity<RevenantOverloadedLightsComponent> component);
}