mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* IoC source gen compatibility Can be merged before or after https://github.com/space-wizards/RobustToolbox/pull/6549 doesn't really matter. * Missed a spot
21 lines
674 B
C#
21 lines
674 B
C#
using Content.Shared.Power.Components;
|
|
|
|
namespace Content.Shared.Power.EntitySystems;
|
|
|
|
public abstract partial class SharedPowerNetSystem : EntitySystem
|
|
{
|
|
[Dependency] private 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);
|
|
}
|
|
}
|