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:
Flipp Syder
2022-01-01 20:56:24 -08:00
committed by GitHub
parent 903f796b0f
commit b1584793bf
71 changed files with 4340 additions and 29 deletions

View File

@@ -1,5 +1,6 @@
using System;
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 +15,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;
@@ -33,19 +37,30 @@ namespace Content.Server.Atmos.Piping.Unary.Components
[ViewVariables(VVAccess.ReadWrite)]
public float InternalPressureBound { get; set; } = 0f;
}
public enum VentPumpDirection : sbyte
{
Siphoning = 0,
Releasing = 1,
}
public GasVentPumpData ToAirAlarmData()
{
if (!IsDirty) return new GasVentPumpData { Dirty = IsDirty };
[Flags]
public enum VentPressureBound : sbyte
{
NoBound = 0,
InternalBound = 1,
ExternalBound = 2,
return new GasVentPumpData
{
Enabled = Enabled,
Dirty = IsDirty,
PumpDirection = PumpDirection,
PressureChecks = PressureChecks,
ExternalPressureBound = ExternalPressureBound,
InternalPressureBound = InternalPressureBound
};
}
public void FromAirAlarmData(GasVentPumpData data)
{
Enabled = data.Enabled;
IsDirty = data.Dirty;
PumpDirection = (VentPumpDirection) data.PumpDirection!;
PressureChecks = (VentPressureBound) data.PressureChecks!;
ExternalPressureBound = (float) data.ExternalPressureBound!;
InternalPressureBound = (float) data.InternalPressureBound!;
}
}
}