Files
OldThink/Content.Server/Power/Components/ApcComponent.cs

48 lines
1.3 KiB
C#
Raw Normal View History

using System;
2022-01-15 11:32:46 -07:00
using Content.Server.Power.EntitySystems;
using Content.Server.Power.NodeGroups;
2021-06-09 22:19:39 +02:00
using Content.Shared.APC;
using Content.Shared.Sound;
2022-01-15 11:32:46 -07:00
using Robust.Shared.Analyzers;
using Robust.Shared.GameObjects;
using Robust.Shared.Maths;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
2022-01-15 11:32:46 -07:00
namespace Content.Server.Power.Components;
2022-01-15 11:32:46 -07:00
[RegisterComponent]
[Friend(typeof(ApcSystem))]
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;
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;
2022-02-17 21:43:24 -05:00
public bool Emagged = 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);
}
}