mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-09-30 08:07:28 +00:00
* initial commit * misc additions and fixes * final tests and additions * cleanup 1 * fix tests and add a test * fix tests AGAIN * abject horror and misery * cleanup * cleanup 2 * address some issues
22 lines
617 B
C#
22 lines
617 B
C#
using Content.Server.Power.Components;
|
|
using Content.Shared.Power.Components;
|
|
using Content.Shared.Power.EntitySystems;
|
|
|
|
namespace Content.Server.Power.EntitySystems;
|
|
|
|
public sealed class PowerStateSystem : SharedPowerStateSystem
|
|
{
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<PowerStateComponent, ComponentStartup>(OnComponentStartup);
|
|
}
|
|
|
|
private void OnComponentStartup(Entity<PowerStateComponent> ent, ref ComponentStartup args)
|
|
{
|
|
EnsureComp<ApcPowerReceiverComponent>(ent);
|
|
SetWorkingState(ent.Owner, ent.Comp.IsWorking);
|
|
}
|
|
}
|