Files
tbd-station-14/Content.Server/Power/Components/ApcComponent.cs
2022-05-13 17:59:03 +10:00

42 lines
1.1 KiB
C#

using Content.Server.Power.EntitySystems;
using Content.Server.Power.NodeGroups;
using Content.Shared.APC;
using Content.Shared.Sound;
namespace Content.Server.Power.Components;
[RegisterComponent]
[Friend(typeof(ApcSystem))]
public sealed class ApcComponent : BaseApcNetComponent
{
[DataField("onReceiveMessageSound")]
public SoundSpecifier OnReceiveMessageSound = new SoundPathSpecifier("/Audio/Machines/machine_switch.ogg");
[ViewVariables]
public ApcChargeState LastChargeState;
public TimeSpan LastChargeStateTime;
[ViewVariables]
public ApcExternalPowerState LastExternalState;
public TimeSpan LastUiUpdate;
[ViewVariables]
public bool MainBreakerEnabled = true;
public bool Emagged = false;
public const float HighPowerThreshold = 0.9f;
public static TimeSpan VisualsChangeDelay = TimeSpan.FromSeconds(1);
// TODO ECS power a little better!
protected override void AddSelfToNet(IApcNet apcNet)
{
apcNet.AddApc(this);
}
protected override void RemoveSelfFromNet(IApcNet apcNet)
{
apcNet.RemoveApc(this);
}
}