Files
tbd-station-14/Content.Server/Light/EntitySystems/RotatingLightSystem.cs
deltanedas 91cfabd6f6 light refactoring/rework (#19314)
Co-authored-by: deltanedas <@deltanedas:kde.org>
2023-09-03 22:31:10 -07:00

25 lines
626 B
C#

using Content.Shared.Light;
using Content.Shared.Light.Components;
using Robust.Shared.GameObjects;
namespace Content.Server.Light.EntitySystems;
public sealed class RotatingLightSystem : SharedRotatingLightSystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<RotatingLightComponent, PointLightToggleEvent>(OnLightToggle);
}
private void OnLightToggle(EntityUid uid, RotatingLightComponent comp, PointLightToggleEvent args)
{
if (comp.Enabled == args.Enabled)
return;
comp.Enabled = args.Enabled;
Dirty(comp);
}
}