Files
tbd-station-14/Content.Shared/Power/EntitySystems/SharedPowerNetSystem.cs
metalgearsloth df2257cd92 Predict gasthermomachines (#33837)
* Predict gasthermomachines

* despawn

* smellby
2025-05-13 21:49:43 +10:00

22 lines
675 B
C#

using Content.Shared.Power.Components;
namespace Content.Shared.Power.EntitySystems;
public abstract class SharedPowerNetSystem : EntitySystem
{
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
public abstract bool IsPoweredCalculate(SharedApcPowerReceiverComponent comp);
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<AppearanceComponent, PowerChangedEvent>(OnPowerAppearance);
}
private void OnPowerAppearance(Entity<AppearanceComponent> ent, ref PowerChangedEvent args)
{
_appearance.SetData(ent, PowerDeviceVisuals.Powered, args.Powered, ent.Comp);
}
}