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:
@@ -1,3 +1,4 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Content.Shared.Examine;
|
||||
using Content.Shared.Power.Components;
|
||||
|
||||
@@ -5,6 +6,16 @@ namespace Content.Shared.Power.EntitySystems;
|
||||
|
||||
public abstract class SharedPowerReceiverSystem : EntitySystem
|
||||
{
|
||||
public abstract bool ResolveApc(EntityUid entity, [NotNullWhen(true)] ref SharedApcPowerReceiverComponent? component);
|
||||
|
||||
public bool IsPowered(Entity<SharedApcPowerReceiverComponent?> entity)
|
||||
{
|
||||
if (!ResolveApc(entity.Owner, ref entity.Comp))
|
||||
return true;
|
||||
|
||||
return entity.Comp.Powered;
|
||||
}
|
||||
|
||||
protected string GetExamineText(bool powered)
|
||||
{
|
||||
return Loc.GetString("power-receiver-component-on-examine-main",
|
||||
|
||||
Reference in New Issue
Block a user