using Content.Shared.DeviceNetwork;
using Content.Shared.DeviceNetwork.Systems;
using Robust.Shared.Serialization;
namespace Content.Shared.Atmos.Monitor;
///
/// Contains .
///
public partial record struct AtmosMonitorDataPayload : INetworkPayload
{
[DataField]
public AtmosMonitorData Data;
}
[Serializable, NetSerializable]
public sealed partial class AtmosMonitorData : BaseAtmosDeviceData
{
public override void RaisePayload(EntityUid uid, string address, SharedDeviceNetworkSystem deviceNetSys)
{
var payload = new AtmosMonitorDataPayload { Data = this };
deviceNetSys.SendPacket(uid, address, ref payload);
}
public AtmosMonitorData(float pressure, float temperature, float totalMoles, AtmosAlarmType alarmState, Dictionary gases, AtmosAlarmThreshold pressureThreshold, AtmosAlarmThreshold temperatureThreshold, Dictionary gasThresholds)
{
Pressure = pressure;
Temperature = temperature;
TotalMoles = totalMoles;
AlarmState = alarmState;
Gases = gases;
PressureThreshold = pressureThreshold;
TemperatureThreshold = temperatureThreshold;
GasThresholds = gasThresholds;
}
/// Most fields are readonly, because it's data that's meant to be transmitted.
///
/// Current pressure detected by this sensor.
///
public float Pressure { get; }
///
/// Current temperature detected by this sensor.
///
public float Temperature { get; }
///
/// Current amount of moles detected by this sensor.
///
public float TotalMoles { get; }
///
/// Current alarm state of this sensor. Does not reflect the highest alarm state on the network.
///
public AtmosAlarmType AlarmState { get; }
///
/// Current number of gases on this sensor.
///
public Dictionary Gases { get; }
public AtmosAlarmThreshold PressureThreshold { get; }
public AtmosAlarmThreshold TemperatureThreshold { get; }
public Dictionary GasThresholds { get; }
}