Power stuff (#31314)

* Power stuff

- Add shared IsPowered
- Add shared ResolveApc
- Move PowerChangedEvent to shared for now
- Add SlimPoweredLight that actually functions how you'd expect a PoweredLight to function it id didn't have a bunch of bloat on it.

* big update

* boing
This commit is contained in:
metalgearsloth
2024-08-25 22:18:42 +10:00
committed by GitHub
parent 3d145875a4
commit a89d4c750b
98 changed files with 236 additions and 18 deletions

View File

@@ -1,3 +1,4 @@
using System.Diagnostics.CodeAnalysis;
using Content.Server.Administration.Logs;
using Content.Server.Administration.Managers;
using Content.Server.Power.Components;
@@ -197,5 +198,17 @@ namespace Content.Server.Power.EntitySystems
{
comp.Load = load;
}
public override bool ResolveApc(EntityUid entity, [NotNullWhen(true)] ref SharedApcPowerReceiverComponent? component)
{
if (component != null)
return true;
if (!TryComp(entity, out ApcPowerReceiverComponent? receiver))
return false;
component = receiver;
return true;
}
}
}