light refactoring/rework (#19314)
Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
24
Content.Server/Light/EntitySystems/RotatingLightSystem.cs
Normal file
24
Content.Server/Light/EntitySystems/RotatingLightSystem.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user