CatStation/Content.Server/Power/Components/ApcPowerReceiverComponent.cs
Whatstone 56c459e98c
Make more ApcPowerReceiverComponent fields DataFields (#45022)
* Dirty ApcPowerReceiver if state doesn't match defs

* surely this will work and isn't massive hubris

* SPACE

* docs & comments

* voltage, not charge

* no space

* jfc
2026-07-30 05:10:39 +00:00

42 lines
1.1 KiB
C#

using Content.Server.Power.Pow3r;
using Content.Shared.Power.Components;
namespace Content.Server.Power.Components;
/// <inheritdoc />
[RegisterComponent]
public sealed partial class ApcPowerReceiverComponent : SharedApcPowerReceiverComponent
{
/// <inheritdoc />
public override float Load
{
get => NetworkLoad.DesiredPower;
set => NetworkLoad.DesiredPower = value;
}
/// <summary>
/// The component currently providing this entity with power.
/// </summary>
public ApcPowerProviderComponent? Provider = null;
/// <inheritdoc />
public override bool PowerDisabled
{
get => !NetworkLoad.Enabled;
set => NetworkLoad.Enabled = !value;
}
/// <summary>
/// The load of the network as an object used by Pow3r.
/// </summary>
[ViewVariables]
public PowerState.Load NetworkLoad { get; } = new PowerState.Load
{
DesiredPower = 5
};
/// <summary>
/// The power currently being received, in watts.
/// </summary>
public float PowerReceived => NetworkLoad.ReceivingPower;
}