Files
tbd-station-14/Content.Server/Power/EntitySystems/StaticPowerSystem.cs
Ed 437fc936a2 LatheSystem independently of energy (#30148)
* Update LatheSystem.cs

* Emo
2024-07-18 22:29:20 +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;
}
}