Files
crystall-punk-14/Content.Client/Power/EntitySystems/PowerReceiverSystem.cs

24 lines
706 B
C#
Raw Normal View History

using Content.Client.Power.Components;
using Content.Shared.Power.Components;
using Content.Shared.Power.EntitySystems;
using Robust.Shared.GameStates;
namespace Content.Client.Power.EntitySystems;
public sealed class PowerReceiverSystem : SharedPowerReceiverSystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<ApcPowerReceiverComponent, ComponentHandleState>(OnHandleState);
}
private void OnHandleState(EntityUid uid, ApcPowerReceiverComponent component, ref ComponentHandleState args)
{
if (args.Current is not ApcPowerReceiverComponentState state)
return;
component.Powered = state.Powered;
}
}