6
2026-01-24 12:49:55 +03:00

17 lines
520 B
C#

using Content.Server.Power.Components;
namespace Content.Server.Power.EntitySystems;
public static class StaticPowerSystem
{
// Using this makes the call shorter.
// ReSharper disable once UnusedParameter.Global
public static bool IsPowered(this EntitySystem system, EntityUid uid, IEntityManager entManager, ApcPowerReceiverComponent? receiver = null)
{
if (receiver == null && !entManager.TryGetComponent(uid, out receiver))
return true;
return receiver.Powered;
}
}