Files
crystall-punk-14/Content.Server/Power/Components/ApcComponent.cs

52 lines
1.5 KiB
C#
Raw Normal View History

using Content.Server.Power.NodeGroups;
2021-06-09 22:19:39 +02:00
using Content.Shared.APC;
2022-07-29 14:13:12 +12:00
using Robust.Shared.Audio;
2022-01-15 11:32:46 -07:00
namespace Content.Server.Power.Components;
2022-01-15 11:32:46 -07:00
[RegisterComponent]
public sealed class ApcComponent : BaseApcNetComponent
2022-01-15 11:32:46 -07:00
{
[DataField("onReceiveMessageSound")]
public SoundSpecifier OnReceiveMessageSound = new SoundPathSpecifier("/Audio/Machines/machine_switch.ogg");
2022-01-15 11:32:46 -07:00
[ViewVariables]
public ApcChargeState LastChargeState;
public TimeSpan LastChargeStateTime;
/// <summary>
/// Is the panel open for this entity's APC?
/// </summary>
[DataField("open")]
public bool IsApcOpen { get; set; }
2022-01-15 11:32:46 -07:00
[ViewVariables]
public ApcExternalPowerState LastExternalState;
public TimeSpan LastUiUpdate;
2022-01-15 11:32:46 -07:00
[ViewVariables]
public bool MainBreakerEnabled = true;
public bool HasAccess = false;
2022-01-15 11:32:46 -07:00
public const float HighPowerThreshold = 0.9f;
public static TimeSpan VisualsChangeDelay = TimeSpan.FromSeconds(1);
2022-01-15 11:32:46 -07:00
// TODO ECS power a little better!
protected override void AddSelfToNet(IApcNet apcNet)
{
apcNet.AddApc(this);
}
2022-01-15 11:32:46 -07:00
protected override void RemoveSelfFromNet(IApcNet apcNet)
{
apcNet.RemoveApc(this);
}
[DataField("screwdriverOpenSound")]
public SoundSpecifier ScrewdriverOpenSound = new SoundPathSpecifier("/Audio/Machines/screwdriveropen.ogg");
[DataField("screwdriverCloseSound")]
public SoundSpecifier ScrewdriverCloseSound = new SoundPathSpecifier("/Audio/Machines/screwdriverclose.ogg");
}