using Content.Shared.Atmos.Monitor;
using Robust.Shared.Audio;
namespace Content.Server.Atmos.Monitor.Components
{
// AtmosAlarmables are entities that can be alarmed
// by a linked AtmosMonitor (alarmer?) if a threshold
// is passed in some way. The intended use is to
// do something in case something dangerous happens,
// e.g., activate firelocks in case a temperature
// threshold is reached
//
// It goes:
//
// AtmosMonitor -> AtmosDeviceUpdateEvent
// -> Threshold calculation
// -> AtmosMonitorAlarmEvent
// -> Everything linked to that monitor (targetted)
///
/// A component to add to device network devices if you want them to be alarmed
/// by an atmospheric monitor.
///
[RegisterComponent]
public sealed class AtmosAlarmableComponent : Component
{
[ViewVariables]
public List LinkedMonitors { get; set; } = new();
[ViewVariables] public AtmosMonitorAlarmType LastAlarmState = AtmosMonitorAlarmType.Normal;
[ViewVariables] public AtmosMonitorAlarmType HighestNetworkState = AtmosMonitorAlarmType.Normal;
[ViewVariables] public bool IgnoreAlarms { get; set; } = false;
[DataField("alarmSound")]
public SoundSpecifier AlarmSound { get; set; } = new SoundPathSpecifier("/Audio/Machines/alarm.ogg");
[DataField("alarmVolume")]
public float AlarmVolume { get; set; } = -10;
///
/// List of prototypes that this alarmable can be
/// alarmed by - must be a prototype with AtmosMonitor
/// attached to it
///
[DataField("alarmedBy")]
public List AlarmedByPrototypes { get; } = new();
}
}