mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 21:48:58 +03:00
* 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)
29 lines
1007 B
C#
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")));
|
|
}
|
|
}
|