Files
Delta-v/Content.Server/Power/EntitySystems/PowerStateSystem.cs
T
ArtisticRoomba 11dc186941 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-06-29 12:43:37 +02:00

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