Adds fire/air alarms (#5018)
Co-authored-by: Vera Aguilera Puerto <6766154+Zumorica@users.noreply.github.com> Co-authored-by: E F R <602406+Efruit@users.noreply.github.com> Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Content.Shared.Atmos;
|
||||
using Content.Shared.Atmos.Piping.Unary.Components;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.ViewVariables;
|
||||
@@ -14,6 +16,9 @@ namespace Content.Server.Atmos.Piping.Unary.Components
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public bool Enabled { get; set; } = true;
|
||||
|
||||
[ViewVariables]
|
||||
public bool IsDirty { get; set; } = false;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public bool Welded { get; set; } = false;
|
||||
|
||||
@@ -22,13 +27,7 @@ namespace Content.Server.Atmos.Piping.Unary.Components
|
||||
public string OutletName { get; set; } = "pipe";
|
||||
|
||||
[ViewVariables]
|
||||
public readonly HashSet<Gas> FilterGases = new()
|
||||
{
|
||||
Gas.CarbonDioxide,
|
||||
Gas.Plasma,
|
||||
Gas.Tritium,
|
||||
Gas.WaterVapor
|
||||
};
|
||||
public readonly HashSet<Gas> FilterGases = GasVentScrubberData.DefaultFilterGases;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public ScrubberPumpDirection PumpDirection { get; set; } = ScrubberPumpDirection.Scrubbing;
|
||||
@@ -38,11 +37,36 @@ namespace Content.Server.Atmos.Piping.Unary.Components
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public bool WideNet { get; set; } = false;
|
||||
}
|
||||
|
||||
public enum ScrubberPumpDirection : sbyte
|
||||
{
|
||||
Siphoning = 0,
|
||||
Scrubbing = 1,
|
||||
public GasVentScrubberData ToAirAlarmData()
|
||||
{
|
||||
if (!IsDirty) return new GasVentScrubberData { Dirty = IsDirty };
|
||||
|
||||
return new GasVentScrubberData
|
||||
{
|
||||
Enabled = Enabled,
|
||||
Dirty = IsDirty,
|
||||
FilterGases = FilterGases,
|
||||
PumpDirection = PumpDirection,
|
||||
VolumeRate = VolumeRate,
|
||||
WideNet = WideNet
|
||||
};
|
||||
}
|
||||
|
||||
public void FromAirAlarmData(GasVentScrubberData data)
|
||||
{
|
||||
Enabled = data.Enabled;
|
||||
IsDirty = data.Dirty;
|
||||
PumpDirection = (ScrubberPumpDirection) data.PumpDirection!;
|
||||
VolumeRate = (float) data.VolumeRate!;
|
||||
WideNet = data.WideNet;
|
||||
|
||||
if (!data.FilterGases!.SequenceEqual(FilterGases))
|
||||
{
|
||||
FilterGases.Clear();
|
||||
foreach (var gas in data.FilterGases!)
|
||||
FilterGases.Add(gas);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user