Files
wwdpublic/Content.Shared/Power/EntitySystems/SharedPowerReceiverSystem.cs
Fildrance a840c6eeb9 Fixup playerspawn stuff (#31546)
* Fixup playerspawn stuff

- Also removed arrivals forcing, this should just turn containerspawnpoint off.

* fix this one

* test fix

* really fix

(cherry picked from commit 1a6bd6f3f14ef1446801c90a3b78c84ab0398eb2)
2025-01-14 02:09:30 +03:00

29 lines
1007 B
C#

using System.Diagnostics.CodeAnalysis;
using Content.Shared.Power.Components;
namespace Content.Shared.Power.EntitySystems;
public abstract class SharedPowerReceiverSystem : EntitySystem
{
public abstract bool ResolveApc(EntityUid entity, [NotNullWhen(true)] ref SharedApcPowerReceiverComponent? component);
/// <summary>
/// Checks if entity is APC-powered device, and if it have power.
/// </summary>
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",
("stateText", Loc.GetString(powered
? "power-receiver-component-on-examine-powered"
: "power-receiver-component-on-examine-unpowered")));
}
}