mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* 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
42 lines
1.1 KiB
C#
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;
|
|
}
|