mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03: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
21 lines
617 B
C#
21 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);
|
|
}
|
|
}
|