CatStation/Content.Server/Power/EntitySystems/PowerStateSystem.cs
ArtisticRoomba 1b1cb64d24
Power Consumers Rebalance: Simple Dynamic Power Loading (#41961)
* 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
2026-01-21 04:05:44 +00:00

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);
}
}