mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 21:48:58 +03:00
A lot of BUIs aren't going to handle the state coming in cleanly but we can fix em as we find em. (cherry picked from commit e4a5f2a1450d226bf281e46f1323f41213707bb6)
17 lines
521 B
C#
17 lines
521 B
C#
using Content.Client.Power.Components;
|
|
|
|
namespace Content.Client.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 false;
|
|
|
|
return receiver.Powered;
|
|
}
|
|
}
|