Files

17 lines
521 B
C#
Raw Permalink Normal View History

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)
{
2023-01-18 05:44:32 +11:00
if (receiver == null && !entManager.TryGetComponent(uid, out receiver))
return false;
return receiver.Powered;
}
}